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.

Using snippets within tags to evaluate expressions

July 15, 2011 1:06am

Subscribe [1]
  • #1 / Jul 15, 2011 1:06am

    BrianPx

    14 posts

    II want to evalute this expression using “Doe, John” as a snippet:

    {if title== "Doe, John"}
    ..do something
    {/if}

    To this I created the snippet:
    Snippet Name: last-first

    {exp:member:custom_profile_data}
      {last-name}, {first-name}
    {/exp:member:custom_profile_data}

    And indeed the snippet evaluates properly…
    {last-first} evaluates to Doe, John

    However, this expression does not work.

    {if title==last-first}
    ..do something
    {/if}

    I tried nesting a tag in a tag like {if title=={last-first}} which throws an error.

    Any ideas how I can make this work?

  • #2 / Jul 15, 2011 1:27pm

    Kevin Smith

    4784 posts

    Hi BrianPx,

    What error does it throw when you try {if title=={last-first}}?

    Could you put this into your template inside the Channel Entries Tag and let me know the output?

    {title}
    {last-first}

    Also, have you tried this?

    {if title == "{last-first}"}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases