We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

dynamic menu from channel entries / if loc

How Do I?

Eastwood Design's avatar
Eastwood Design
605 posts
10 years ago
Eastwood Design's avatar Eastwood Design

Why doesn’t this code mark the active entry as selected:

Template visit/.menu

{exp:channel:entries orderby="title" sort="asc" channel="visit" dynamic="no" show_empty="no" show_future_entries="yes" show_expired="no"} 
  <li {if embed:loc== "{url_title}"}class="selected"{/if}><a href="http://{title_permalink=visit}">{title}</a></li>
  {/exp:channel:entries}

ON my main template I have {embed="visit/.menu" loc="{segment_2}”}

where {segment_2} == {url_title}

       
Boyink!'s avatar
Boyink!
5,011 posts
10 years ago
Boyink!'s avatar Boyink!

Try variations with out the quotes.

       
Eastwood Design's avatar
Eastwood Design
605 posts
10 years ago
Eastwood Design's avatar Eastwood Design

weird I removed the quoted here: {if embed:loc== "{url_title}”} and didn’t work, added them back and it worked. Thanks for your advice! it indirectly solved my problem.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.