Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Today 10:48:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,486
Website GitHub

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

#2 Today 16:15:51

giz
Plugin Author
From: New Zealand
Registered: 2004-07-26
Posts: 439
Website GitHub Twitter

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

#3 Today 19:32:58

etc
Developer
Registered: 2010-11-11
Posts: 5,685
Website GitHub

Re: Proper way to pass yield on

There is certainly a flaw somewhere. Probably a by-product of processing changes to allow php in forms, will check.

Offline

Board footer

Powered by FluxBB