Is it possible to put nest custom module tags inside variable pairs of another custom module tag?
Example.
{exp:race_results:show_driver_race_results_header}
{results_header_bio}
{exp:publish_article:article_assets}{/exp:publish_article:article_assets}
{/results_header_bio}
{/exp:race_results:show_driver_race_results_header}
I ask because I am trying to do just that, yet am seeing some odd behavior.
When {exp:publish_article:article_assets}{/exp:publish_article:article_assets} gets processed by the Template class, the closing tag is not found. Below is an output snippet from template logging.
(0.064735) Tag: {exp:publish_article:article_assets} (0.065090) No Closing Tag
I am POSITIVE that the opening and closing tag exist, are properly formatted and there are no typos.
Mod Edit: Moved to the Modules Technical Assistance forum.
Some debugging has revealed oddities in the template class which are causing the issue.
When the template class parses a template, it slices out sections using {exp:} tags as boundaries. The data within is processed by EE, this processing does not however include recursive parsing of {exp:} tags.
During debugging I notice that after all of the initial slicing occurs, EE makes a second pass at my template, and starts processing my inner {exp:} tag (haven’t figured out why yet).
During this second pass, the template parse seems to break
$out_point = strpos($this->fl_tmpl, $cur_tag_close);
inspecting
$this->fl_tmpl
shows that it contains my tag, and that
$cur_tag_close
is my close.
However, FALSE is returned by strpos(). Which, as you know, means the needle doesn’t exist in the haystack.
My initial feeling is that there is an issue with the HTML entity conversions that are occurring. Unfortunately due to pending a deadline, I implemented a workaround and really haven’t done a deeper dive.
Incidentally, while module nesting can often work, and I suspect that Jamie will not have difficulties, that’s typically not the intention. Plugins are designed to work within one another and within module tags, but module tags should typically be on their own.
From looking at your template code above, I can’t help but think that you are recreating functionality that you could already have with relationships and weblog entries.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.