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.

Structure Entries menu

March 18, 2012 1:51pm

Subscribe [2]
  • #1 / Mar 18, 2012 1:51pm

    fensterbaby

    289 posts

    Why does this not work…

    <ul class="sidemenu">
    {exp:structure_entries orderby="title" dynamic="no" parent="12" depth="1"}
    {if last_segment== url_title}
    <li class="selected">{short_page_title}</li>
    {if:else}
    <li><a href="http://{page_uri}">{short_page_title}</a></li>
    {/if}
    {/exp:structure_entries}
    </ul>

    but this does?

    <ul class="sidemenu">
    {exp:structure_entries orderby="title" dynamic="no" parent="12" depth="1"}
    <span>{url_title}{last_segment}</span>
    {if last_segment== url_title}
    <li class="selected">{short_page_title}</li>
    {if:else}
    <li><a href="http://{page_uri}">{short_page_title}</a></li>
    {/if}
    {/exp:structure_entries}
    </ul>

    This is a really stupid solution, but if I don’t first fetch the values it does not eveluate.

    What am I doing wrong here?

    thanks

  • #2 / Mar 18, 2012 8:07pm

    the3mus1can

    426 posts

    Quickly browsing through the source of the plugin it looks like it might be an issue with the method the author is using to parse the variables.  Try something like this:

    <ul class="sidemenu">
    {exp:structure_entries orderby="title" dynamic="no" parent="12" depth="1"}
    {if last_segment== "{url_title}"}
    <li class="selected">{short_page_title}</li>
    {if:else}
    <li><a href="http://{page_uri}">{short_page_title}</a></li>
    {/if}
    {/exp:structure_entries}
    </ul>
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases