Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Article list with class on current article
This seems simple enough to do, but I cannot seem to figure out how to do it.
I begin with a landing page here (http://64.39.65.92/?s=projects) for my projects section.
Then, I click on one of the categories along the top (ie. Commercial) and I go here: http://64.39.65.92/index.php?s=projects&c=commercial
The URL is nicely concatenated with the section and category, and notice that the category commercial has an active class applied to it.
So, what I can’t figure out is this:
1. I want a list on the right of all articles (essentially recent articles except limited to section and class) in “s=projects&c=commercial” (or whatever the category currently is).
2. When I click one of the articles, I want that article to take on an active class just like the category did. And, I don’t want to lose my active class on my category.
I’m making it work the cheap way right now. The list consists of the current article title wrapped in a link, followed by a related articles list. That’s why the current one jumps to the top when you click it. It’s cheesy.
Work until your carpal tunnel makes you cry.
—————————-
My “bloggy” TP site >> liberalrevolt.com
Offline
#2 2007-07-25 10:24:33
- kevinmcdougall
- Member
- Registered: 2007-02-08
- Posts: 55
Re: Article list with class on current article
I use a plugin for inserting the active class into article lists, using it as shown in the form below:
<li><a <txp:glx_hl_current_article class="active"/> href="<txp:permlink />" title="<txp:title />"><txp:title /></a></li>
Is that the kind of thing you meant?
Offline
Re: Article list with class on current article
Perhaps what I wrote was a bit confusing. Ideally, I need a list of ALL articles where the link is formed like this:
http://64.39.65.92/index.php?s=projects&c=commercial&id=2
Essentially, the section, category, and article can all be read from this link, and a class of current can be appended to each.
Work until your carpal tunnel makes you cry.
—————————-
My “bloggy” TP site >> liberalrevolt.com
Offline
Re: Article list with class on current article
You want that the navigation’s articles changes with the browsed category and section? Or do you want that articles won’t change with the category?
Do you mean articles by a category and section?
<txp:if_section name="projects">
<txp:if_category name="commercial">
<txp:custom_article form="default" limit="9999" category="commercial" section="projects" />
</txp:if_category>
</txp:if_section>
Offline