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

Help with the tag pairs and usage

Development and Programming

Erin Dalzell's avatar
Erin Dalzell
790 posts
16 years ago
Erin Dalzell's avatar Erin Dalzell

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?

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
16 years ago
Erin Dalzell's avatar Erin Dalzell

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.

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

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 😉 .

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
16 years ago
Erin Dalzell's avatar Erin Dalzell

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?

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

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?

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
16 years ago
Erin Dalzell's avatar Erin Dalzell

Perhaps I am again not being clear. If I just use one set of the tag pairs, everything works fine. I was more asking a question about how EE parses the tags and if I CAN have more than one set of the same tag pair within a module/plugin tag.

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

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.

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
16 years ago
Erin Dalzell's avatar Erin Dalzell

Duh, of course. This is my plugin…if I want to parse both, I can. I’m an idiot.

Thanks

       

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.