Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Get <txp:yield/> value in PHP
Hello,
How do you get the value of <txp:yield/> in PHP? I’m trying to do the following:
<txp:php>
echo “<txp:article_custom id=’” . $yield . “’><txp:permlink><txp:lam_article_image width=‘230’/></txp:permlink></txp:article_custom>”;
</txp:php>
Thanks,
Jonathan
Offline
Re: Get <txp:yield/> value in PHP
Whoops, I needed to call the function yield() rather than the variable. This works:
<txp:php>
echo "<txp:article_custom id='" . yield() . "'><txp:permlink><txp:lam_article_image width='230'/></txp:permlink></txp:article_custom>";
</txp:php>
Offline
Re: Get <txp:yield/> value in PHP
You could also try:
<txp:article_custom id='<txp:yield />'><txp:permlink><txp:lam_article_image width='230'/></txp:permlink></txp:article_custom>
Check that those are single quotes, mandatory to use them when nesting using txp tag as another txp tag attribute.
Offline
Re: Get <txp:yield/> value in PHP
instead of echo you sholud use echo parse('<txp:any_tag />');
or echo any_tag(array('attr1_name'=>'attr1_value', 'attr2_name'=>'attr2_val'));
Evety txp’s tag has twin-function in php.
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Pages: 1