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

Plugin getting called when it shouldn’t be!

Development and Programming

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

Here is my template, simplified:

<div id="content-wrapper">
        {exp:categoree parse="inward"}
        {if total_files > 0}
            <div id="content">
                <div id="image">
                    {exp:get_image parse="inward"}
                        {exp:gallery:entries entry_id="{entry_id}" gallery="{gallery_name}"}
                            {image_url}
                        {/exp:gallery:entries}
                    {/exp:get_image}
                </div> <!-- end image     -->
            </div> <!-- content -->
        {if:else}
    
                <div id="image">
                    woo hoo!!
                </div> <!-- end image     -->
            </div> <!-- content -->

        {/if}
        {/exp:categoree}
    </div> <!-- content-wrapper -->

My issue is when I am in the ‘else’ statement, the get_image plugin is still being called. I can tell because I see an error, “Notice: Undefined offset: 0 in /home/thedalzells.org/flibberflabber/plugins/pi.get_image.php on line 86”

Why is EE calling the plugin when it shouldn’t be?

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
17 years ago
Lisa Wess's avatar Lisa Wess

The conditional seems to be something you’re testing against another plugin? the total_files?

{exp:categoree parse="inward"}
        {if total_files > 0}

that’s something that you would need to look to your plugin for. I’m going to pop this down to the plugins technical forum for help with this.

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

Yes, the conditional works great. My question is, when total_files == 0, the {exp:get_image} is still being called, when it shouldn’t be, as it should only be called when total_files > 0.

When I turn on template debugging, I see that EE parses the tag and it must call the plugin as I am getting an error.

I have worked around this issue as both plugins are mine, but I would like to know why the plugin is getting called when it is in the FALSE side of the conditional.

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.