Search code examples
expressionengine

expressionengine conditional


I have a simple plugin that outputs a number using {exp:number}. How can I use this in a conditional. like

{if {exp:number} > 2} Greater then two {/if}

I can't get this to work.


Solution

  • I haven't written a plugin but whenever I've seen them used as a conditional they are enclosed in quotation marks:

    {if "{exp:my_plugin:correct_answer question='{question}'}"}Congratulations!{/if}
    

    I'm not sure how you apply this to magnitude comparisons, but you might find more help on this thread in the EE forums:

    http://expressionengine.com/forums/viewthread/194654/#918764