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

navigation and conditionals

Development and Programming

fin's avatar
fin
168 posts
12 years ago
fin's avatar fin

I’m running v2.6.1 - Build: 20130506 -. I apologize in advance, but it has been while since I worked on a Expression site. I’m having trouble with dynamic navigation and simple conditionals (sorry I’m also having trouble with my conditional code showing up in this post. {if segment_1==""} is after the a tag as are the rest) I changed categories to readings.

<nav class="group" role="navigation">
  <ul id="nav" class="group">
      <li><a href="/class=active"><strong>now</strong></a></li>
   <li><a href="/articles/class=active"><strong>desk</strong></a></li>
   <li><a href="/book-readings/readings/class=active"><stong>books</stong></a></li>
   <li><a href="/shelf/readingsclass=active"><strong>shelf</strong></a></li>
  </ul>
</nav>

When I inspect the code in the browser, the conditional code shows up? I also noticed that the end tag doesn’t show {/if} i.e.

<a href="/articles/%22if=%22" class="active"><strong>articles</strong></a>

I run into this problem before, and the suggested solution was using a plugin. I’d rather not do that.

       
DevServe's avatar
DevServe
65 posts
12 years ago
DevServe's avatar DevServe

You need to post your template code. Take a look at the tutorials on building navigation on Train-EE site. They got me started in the right direction.

I’m now working on two tutorials on possible ways to create dynamic menus in EE without plugins and complexity.

       
DevServe's avatar
DevServe
65 posts
12 years ago
DevServe's avatar DevServe

I have my tutorial posted: http://ellislab.com/forums/viewthread/237299/

       
fin's avatar
fin
168 posts
12 years ago
fin's avatar fin

Thanks for the response. I’m looking over that page you sent. Yeah, I tried to post the template code, but every time I posted, the form removed that code. For anyone checking this thread, I’ve decided not to use the plugin switchee because it’s used for complex conditionals, not simple.

       
DevServe's avatar
DevServe
65 posts
12 years ago
DevServe's avatar DevServe

Did you wrap the CODE tags around your EE template tag when posting?

       
fin's avatar
fin
168 posts
12 years ago
fin's avatar fin

Yes, I did, a few times.

       

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.