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.

Creating a dynamic sub-navigation

June 21, 2007 8:08pm

Subscribe [2]
  • #1 / Jun 21, 2007 8:08pm

    humain

    2 posts

    I was hoping somebody could clue me in to how to do this.  Heres the basic setup for my site.

    I have seven weblogs created, one for each main section of the site.

    All of these sections have their own categories within them.  I’ve created a category group, with categories within them, for each section (weblog).

    I’ve created two templates: index and article.

    The index template is the homepage and contains all of my posts.  When you click on a post from the homepage it takes you to the post, which is displayed using the article template.

    These articles have a left navigation which should list the categories within the weblog that the post originates from.  So how can I do this using one (articles) template?  I’d rather not have to create a template for each weblog since the layout of each category template is identical sans the left nav items and the weblog name at the top of it.  Are there conditional tags that can tell the template which weblog the post originates from.?

    Any help would be appreciated and if I can give you more information to make this more clear I’d be happy to.

    Thanks!

    Jesse

  • #2 / Jun 22, 2007 6:45am

    silenz

    1651 posts

    At least with EE 1.6 it is simple due to the {weblog_short_name} variable.

    {exp:weblog:entries limit="1" disable="member_data|trackbacks|categories|pagination|custom_fields"}
    
    {exp:weblog:categories weblog="{weblog_short_name}" style="nested" disable="category_fields" show_empty="yes"}
    <a href="http://">{category_name}</a>
    {/exp:weblog:categories}
    
    {/exp:weblog:entries}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases