Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-05-10 20:35:56

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Styling list of <txp:recent_articles />?

How can I style the <a>‘s in the rendered list of <txp:recent_articles />? Say, to put an (background)image left or right to the ‘active’ state? I hope it’s clear.

Last edited by RedFox (2007-05-10 20:36:32)

Offline

#2 2007-05-10 23:58:54

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Styling list of <txp:recent_articles />?

My CSS is not the strongest, but my first try with the default class and a wraptag of ul and break of li would be:

.recent_articles ul li a {

}

to style the specific anchor link.

Offline

#3 2007-05-11 12:02:12

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: Styling list of <txp:recent_articles />?

@rsilletti > Yes, I know … but I wan’t to make adjustments so that say the third <li> of that list gets a ‘highlight’ … as if the list was a navigation so people can see which article is ‘active’.

I want this to happen because the (real) title of the article is hidden and so there could be some misunderstanding where people are.

Here is the page I’m working on.

Offline

#4 2007-05-11 13:30:45

TNT
Member
From: Rotterdam, Netherlands
Registered: 2006-01-06
Posts: 256
Website

Re: Styling list of <txp:recent_articles />?

Just a wild shot: use at own risk! :-)

<txp: if_article_id id="<txp: article_id />">li which is highlighted
<txp: else />
normal li
</txp: if_article_id>

Of course you will need to squeeze in an asy_wondertag there. If this doesn’t work, which is most probably the case, I hope it will put you on the right track…

Come to think of it: I have no clue how to combine this with a recent_articles list. Oh well…

Last edited by TNT (2007-05-11 13:36:01)


Prrrrrrrr

Offline

#5 2007-05-11 22:20:08

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Styling list of <txp:recent_articles />?

if_article_id and asy_wondertag is probably a good approach, you might look at using article_custom rather than recent_articles so that you can use the form attribute. Bearing in mind that you need to use an article tag at some point to generate the article id.

Offline

Board footer

Powered by FluxBB