Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-04-23 15:05:59

Polleke
New Member
From: Nederland
Registered: 2006-04-14
Posts: 2
Website

Link to each category in different colour - how to?

I’d like to display on the main page of my site just the exepts of the articles with the common things like title, author, date and category. Author and category are links to lists of articles in the category chosen, or by the author chosen.

All goes well, but i’d like to add a little flavour. I’d like to have each category a different colour. Not the articles itself, but just the link to the category underneath the exerpt.

To make it even more nice I’d like to have the name of the category preceded by a tiny icon. Still just in the usual line with author and date.

I’m more than happy with a solution to colour the link of the different categories, the icon’s are just a little extra… :-)

Offline

#2 2006-04-23 17:49:04

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Link to each category in different colour - how to?

Hi Paul, this is more a Layout & CSS question, so if this won’t help you, you’d better post there, but here goes:

<div class="<txp:category1 />"><txp:category1 link="1" /></div> in the article form.
<br />In the CSS you can style it:
<code>.cat1 a {color: #xxx;}
.cat1 {background: url(/images/iconcat1.gif);}
.cat2 a</code> etcetera, and so for every category (cat1 and cat2 being of course the names of your categories).

Offline

Board footer

Powered by FluxBB