Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Proper way to pass yield on
Hmmm. Article content:
blah blah blah
...
<txp::book>Book this course</txp::book>
The book shortcode passes the container content onto a second, general purpose shortcode:
<txp::email><txp:yield /></txp::email>
The email shortcode displays a hyperlink with the passed content:
<a href="mailto:test@example.org"><txp:yield /></a>
Result: Boooooooooooooom
Uncaught Error: Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size – zend.reserved_stack_size) reached. Infinite recursion? in /path/to/textpattern/publish/taghandlers.php:465.
Is there no way to pass the yielded content on directly? (The email shortcode is more complicated than that, btw, as it does other stuff like responding to attributes governing whether to add a ?subject and classes and so on).
I can get round it this way:
<txp:variable name="content"><txp:yield /></txp:variable>
<txp::email><txp:variable name="content" /></txp::email>
Just curious if there’s a better way or I’m doing something wrong.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Proper way to pass yield on
Does <txp::book foo="Book this course" /> and <txp:yield name="foo" /> smooth things, or same-ol?
Offline
Pages: 1