Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-04-11 13:01:13

Depot 1
Member
From: Copenhagen
Registered: 2011-01-03
Posts: 24
Website

article list disappears in navigation

Hi,
I am trying to reuse a code for a 2-level navigation, but it’s not working as supposed to.
The original navigation was based on sections, but in order to make the end user of the website able to apply new links in the navigation as easy as possible, I am trying to use categories instead.
The problem is, that when selecting an article (within a category), the article list disappears.

Here is a dummy of the website with the code in effect: link

The navigation is on the right. ‘Fields’ is a category, ‘1’ and ‘2’ are article titles. When selected the article shows but the article list disappears from the navigation.

The navigation is based on the forms ‘nav’, ‘nav.build’ and ‘nav.build.link’.

This is the code for ‘nav’:

  <txp:category_list  wraptag="ul" break="" form="nav.build" active_class="active" />

This is the code for ‘nav.build’:


<li<txp:if_category name='<txp:category />'> class="active"</txp:if_category>><txp:category title="1" link="1" />

<txp:if_category name='<txp:category />'>

<txp:if_variable name="hasstickyarticle" value="">

   <txp:if_variable name="hasmorelivearticles" value="">

   <txp:else />

      <txp:article_custom category='<txp:category />' form="nav.build.link" wraptag="dl" break="" />

   </txp:if_variable>

<txp:else />

   <txp:article_custom category='<txp:category />' form="nav.build.link" wraptag="dl" break="" />

</txp:if_variable>

</txp:if_category>
</li>

This is the code for ‘nav.build.link’:

<dt<txp:if_article_id> class="active"</txp:if_article_id>><a href="<txp:permlink />"><txp:title /></a></dt>

Since this code worked perfectly when using sections instead of categories, I guess that’s the problem. But can anyone help me solve this?

Any help is highly appreciated!!!

Last edited by Depot 1 (2011-04-11 13:26:38)

Offline

#2 2011-04-11 13:11:17

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,002
Website GitHub Mastodon Twitter

Re: article list disappears in navigation

Hi Snorre

is this what you are trying to achieve?

ps. you escape bc.. by starting your next paragraph with a p.

Last edited by colak (2011-04-11 13:12:17)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2011-04-11 13:25:21

Depot 1
Member
From: Copenhagen
Registered: 2011-01-03
Posts: 24
Website

Re: article list disappears in navigation

Hi Colak
Well, I guess it is. I actually looked at the code, you’re linking to, earlier on, but the same problem applies I’m afraid. The article list disappears when selecting an article.
But thanks for your reply!

And: Thanks for the tip according to bc.. – it has been driving me nuts!

Last edited by Depot 1 (2011-04-11 13:27:01)

Offline

Board footer

Powered by FluxBB