We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Placing module tags with variable pairs

Development and Programming

MindComet's avatar
MindComet
20 posts
17 years ago
MindComet's avatar MindComet

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.

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
17 years ago
Jamie Poitra's avatar Jamie Poitra

Hmm…

I could swear I’ve done this before without problems.

What happens if you put the opening and closing tags of the problem function on different lines?

Jamie

       
MindComet's avatar
MindComet
20 posts
17 years ago
MindComet's avatar MindComet

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.

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
17 years ago
Jamie Poitra's avatar Jamie Poitra

MindComet,

I have a module myself I’ll be working on a bit today. I’ll see if I can reproduce this at all.

Jamie

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.