1

I have wrapped this in a Snippet to advance the parsing order, but I cannot seem to get this to work...hence the {?}.

<ul class="accordion">


{exp:channel:category_archive channel="hurricane" style="linear" dynamic="on" }

           {categories}
        {if segment_3 == '{?}'}<li class="active"> {if:else} <li class="">{/if}
          <div class="title">
            <h5>{category_name}</h5>
          </div>{/categories}
          <div class="content">
           {entry_titles}
           <a href="{path='members/hurricane/'}">{title}</a><br />
           {/entry_titles}
          </div>

        </li>
         {/exp:channel:category_archive}            

2
  • I don't believe 'dynamic=on' is a thing, according to the docs anyway. Bit more on what you're trying to achieve with errors or issue would help. – stuartmcd69 Jan 27 '14 at 6:19
  • This code sits in a sidebar on a single entry's template and it simply should highlight the current entry by adding an active class to the <li> tag. – Nutmeg Jan 27 '14 at 9:39
1

Your layout may have to change because EE doesn't yet know if the title is inside the category. If you can transfer the conditional inside the entry_titles you may have better luck.

{entry_titles}
{if segment_x == {url_title}}do something{/if}
{/entry_titles}

EE category stuff can be a pita and I've often used gwCode categories. You do get more flexibility and control but its a case by case thing.

0

What happens when you use:

segment_3 == {category_URL_title}

Assuming you're looking to see if current category is in the URL.

I try and avoid if:else and simply use 2 simples instead or switchee.

1
  • Thanks Stuart, but I'm not looking for the current category - just the current entry.. – Nutmeg Jan 27 '14 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.