Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-05-11 15:55:23

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Upgraded to 4.0.8 but section list doing something weird

The section list is outputting the current section with the class of “here” even though i set it to active.

<txp:section_list wraptag="ul" break="li" class="nav_main" default_title="Home" include_default="1" sections="meditation-classes,day-courses,chanted-meditation,study-programs,events,our-teachers,about,kadampa,faq,akanishta-centre-building-project,newsletter,contact,links" active_class="current" />

Also it is highlighting the home link with “here” no matter what section you’re on.

www.meditationincheltenham.org.uk

Offline

#2 2009-05-11 16:12:22

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Upgraded to 4.0.8 but section list doing something weird

Hi FireFusion,

it’s not TXP fault. The problem is in the default.js file.
There is a highlightPage function that is overwriting the class="current" with class="here".
Also, that same function seems to be the reason for the home link being highlighted.

As all this can be done by TXP (server side), there is no reason to use that JS function, so I believe it can be safely removed.

BTW, the highlightPage function also adds a class to <body>, to identify the current section or article. That can also be done on TXP using <body class="<txp:section /> <txp:article_url_title />" />, or even <txp:body class="<txp:page_url type="s" /> <txp:page_url type="request_uri" />, and of course, it can be refined using some conditionals.

Last edited by maniqui (2009-05-11 16:12:40)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB