1

I have a navigation/URL structure issue, and I haven't been able to find online exactly what I want to accomplish.

I have an "About" template and a "Staff" template - so different URL's for each template. I have two Channels, one for each template, but have only ONE category group.

I've set up the navigation so that I have a drop-down under my "about" navigation item, which lists all of the categories - About, Mission, Staff, Facts. All of the categories, except for Staff, will pull up on the "About" template. I want "Staff," however, to direct to my staff template. Is this possible?

What variable do I use to direct that one category to another template?

I have this code in my nav:

{exp:channel:categories category_group="1" style="linear" show_empty="no"}
                <li><a href="{path='??'}">{category_name}</a></li>
            {/exp:channel:categories}

Navigation

1

In general using categories for navigation on "static" sections can be frustrating. They weren't really designed with that in mind.

In this case I'd try using a conditional inside the loop to look for the staff entry and then build a different link:

{exp:channel:categories category_group="1" style="linear" show_empty="no"}
        <li>
            {if category_url_title != "staff"}
                <a href="{path='about/index'}">{category_name}</a>
            {/if}

            {if category_url_title=="staff"}
                <a href="{site_url}about/staff'}">{category_name}</a>
            {/if}

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

The reason for not using the path linking variable in the second case is that because it's within a category loop EE will create a category link (http://yoursite.com/about/staff/category/category_url_title) which in this case you don't want.

| improve this answer | |

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.