ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

tag code executed regardless of template if logic

June 23, 2011 12:52pm

Subscribe [2]
  • #1 / Jun 23, 2011 12:52pm

    Fritzinger

    35 posts

    I’ve built a custom module which uses tags. In my templates I have some if logic to determine whether the right parameters are present, and if so I pass them to my tag e.g.:

    {if '{embed:param1}'}
      {exp:my_module:my_tag param="{embed:param1}"}
    {/if}

    However I can see from logging output that the code for my_tag runs regardless of the outcome of the if statement. Is that normal?

    Fritz

  • #2 / Jun 23, 2011 2:21pm

    Brandon Jones

    5500 posts

    Hi Fritz,

    Yes, that can happen depending EE’s parse order and what else is in the template. Keep in mind that EE tags aren’t a scripting language. In this case using the embed variable in the conditional is likely going to trigger the advanced conditional mode.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases