Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-10-11 11:03:44

lozmatic
Member
From: Melbourne, Australia
Registered: 2006-08-27
Posts: 259
Website

Styling a link to the 'current' article

I’m using the following code to list linked thumbnails of articles in a category:

http://raymond.kw-wu.com/weddings/michelle-james/1/

Code I’m using is:

<txp:if_article_category><txp:permlink class=“thumb”><txp:article_image class=“thumbnail” thumbnail=“1” /></txp:permlink></txp:if_article_category>

I would like to add a condition so that the thumbnail of the article that is being viewed by the user has another style applied to it.

There is the if_article tag, but it appears that one must include a hard coded article ID.

Any suggestions?

Thank you very much.

Lawrence

Offline

#2 2007-10-11 13:11:34

lozmatic
Member
From: Melbourne, Australia
Registered: 2006-08-27
Posts: 259
Website

Re: Styling a link to the 'current' article

OK, got this working thanks to the wonderful cch_custom_article (http://www.cokesque.com/code/42/chharticlecustom-plugin)

Offline

#3 2007-10-11 14:41:21

lozmatic
Member
From: Melbourne, Australia
Registered: 2006-08-27
Posts: 259
Website

Re: Styling a link to the 'current' article

Actually, I lied. I got something else working with that wonderful tag.

But I think I know how to do this using another awesome plugin… hehe.

(Don’t mind me talking to myself)

Offline

#4 2007-10-11 15:45:04

lozmatic
Member
From: Melbourne, Australia
Registered: 2006-08-27
Posts: 259
Website

Re: Styling a link to the 'current' article

OK, here’s the problem…

I can use a plugin to give a conditional tag (eg. if_article_id) an article ID dynamically. But since all this happens in a form that is called by an article list tag I actually get values for ALL articles generated in the list ( In the example above it’s: 1 2 3 4).

Any alternatives to this method? I tried using <txp:if_individual_article> but that didn’t work.

The ideal solution would be an ‘active_class’ type property for the article_image tag.

Offline

#5 2007-10-11 15:52:22

lozmatic
Member
From: Melbourne, Australia
Registered: 2006-08-27
Posts: 259
Website

Re: Styling a link to the 'current' article

The solution exists. It is easy and was mentioned in a post not very long ago. Arghh.

rvm_if_this_article

I am a very happy person.

Offline

Board footer

Powered by FluxBB