I would like to have something like this:
{exp:gallery_categoree_new:categories gallery_id="1" parse="inward"}
<div id="content">
{if is_root}
{sub_cats}
<!-- categories with no parent are the root ones, which is what I want -->
<div class="root-album">
<a href="http://{path=gallery/bar}{sub_cat_name}">{sub_cat_name}: {sub_cat_description}</a>
<br>
</div> <!-- root-album -->
{/sub_cats}
{!-- the 3rd segment is the years and if 4th segment is empty then display all sub-cats (months) --}
{if:elseif is_sub_cat==false}
<h3>
Header text I want to see only ONCE!
</h3>
{sub_cats}
<div class="album">
.... do different things with the subcat variables
</div> <!-- end album -->
{/sub_cats}
{/if}
</div> <!-- content -->
{/exp:gallery_categoree_new:categories}
The problem is that it appears that you can’t have two sets of the same tag pair within a plugin tag. If I put the sub_cats tag around the whole thing, then the <h3> stuff is repeated for each item within the plugin, which is not what I want.
How can I do what I want?
Not sure if the EL folks peruse the plugins technical support, so I thought I’d ask here. Original thread here.
If this post is not appropriate, please delete or merge.
We do drop by occasionally, but we don’t officially support 3rd party software. That said, it depends on how you’re parsing the nested tags - plugins are parsed no different than modules (such as the weblog module), so it’s up to the developer to make sure the related tags are handled properly.
My guess would be that the regular expression is too greedy.
I’ll close this one, but I’ve subscribed to the other thread to see what you come up with 😉 .
This question may be related to a resolved thread.
Perhaps I wasn’t clear, this is my own plugin that I am using, so I have some questions about how to properly develop and use my own plugin. Does that make me more supportable?
Merged into the plugin forum. As I’ve mentioned, they’re not handled any differently than modules, so you could look at the weblog module’s category tag pair to see how it’s done there (as an example).
But since we’re down here, what code are you using to parse the sub_cats?
We’re still not on the same page :long: .
The EE template parser doesn’t parse variable pairs inside modules or plugins. The template class hands the inner content off to the plugin or module, which then does it’s own parsing. What it does do is check if there are any pairs. From the page I just linked to:
…the $TMPL->var_pair variable does not contain the content of the variable pair, you will have to search the template for it yourself using a preg_match() (or possibly a preg_match_all(), if you believe there could be multiple instances of this variable pair).
Depending on how the plugin is implemented it may or may not work. So in essence the answer is yes, you can have more than one set of the same tag pair, but only if the plugin parses it that way. I know of the weblog module’s category tag that it can be used more than once, hence why I used it as an example.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.