Search code examples
expressionengine

If entry id then show certain content


I've been trying to make something visible only on certain entry_id in expressionengine

{if entry_id="33"} ... show certain content {/if}

is this even possible in eemcs?

thanks


Solution

  • This is what's referred to as a simple conditional in EE, and it's fast enough.

    One very important thing to remember in EE is that the standard if:else/else:if routine of an advanced conditional can be very slow, primarily because EE renders all of the code segments and then works its if:else magic. If you find yourself testing many ids or groups, this slows the site down proportionally. In fact, sometimes EEs parse order can stop if:else from functioning entirely.

    Instead, consider Mark Croxton's Switchee, a fantastic free plugin that lets you have as many conditions, even nested conditions, without slowdown. It parses just the conditions, then when triggered, is smart enough to descend and run the right code segment: