Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-10-17 17:56:38

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Assigning class attribute to links?

I’d like to add a class attribute to links but none of my attempt at syntax worked.

Is there no way to make textile do that?

Offline

#2 2004-10-17 20:10:48

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: Assigning class attribute to links?

Hmmm scaring perspective.

after a bit of investigating i found this:
<code>

‘(class)Link’:url

‘(class#id)Link’:url

</code>

(substitute ‘ with “ in the above)

The above syntax will not work on Textile

but it will work on textilephp for txp which is a php port of a perl thinghy.

I found the above syntax on this Movable type user guide to Textile

I cant belive though that there is no way to style links with class or id’s in Textile. But cant get it to work.
/Hafnius

Last edited by hafnius (2004-10-17 20:13:36)


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#3 2004-10-17 20:36:28

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: Assigning class attribute to links?

Thanks. If this is indeed not included in Textile I will put it into feature requests. I consider it quite basic and very useful.

Offline

#4 2005-11-17 17:11:33

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: Assigning class attribute to links?

Is there a chance that this is going to be added anytime soon?

Offline

#5 2005-11-21 08:55:36

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: Assigning class attribute to links?

I know you understand this, andreas, but I’ll just point it out for others who might not understand the finer control you’re ultimately trying to achieve.

The class would provide finer control, with perhaps the real benefit of requiring fewer characters in the CSS, and that’s good; but one can pretty much style various links types individually already, at least to the parent element level anyway, and that is really all one needs if you are concerned with usability issues (that’s not to suggest having classes will make people ignore usability).

For example, let’s say you have links in a main content area div <code>id=“mca”</code> (your regular article body links), and you have a column box with three contained boxes; <code>id=“top”</code>, <code>id=“middle”</code>, <code>id=“bottom”</code> where you want links to be different in each box position. You can give all four locations unique link styling by using the parent box IDs:

#mca a:link, #mca a:visited {}
#mca a:hover {}
#top a:link, #top a:visited {}
#top a:hover {}
#middle a:link, #middle a:visited {}
#middle a:hover {}
#bottom a:link, #bottom a:visited {}
#bottom a:hover {}

Having classes would only enhance things further, as I see it, by allowing you to create different link styling within the same parent element, and that’s where I would question whether doing so is a good usability practice or not.

Last edited by Destry (2005-11-21 08:59:24)

Offline

#6 2006-06-09 13:35:16

eric2007
Member
Registered: 2006-05-25
Posts: 18

Re: Assigning class attribute to links?

You need the link class attribute to make CSS rollovers, i.e., <a href=“link” class=“rollover”>.

I want to make my next article and previous article links CSS rollovers, but <txp:link_to_prev(/next)> does not support the class attribute, nor can you get a raw link url by using <txp:link_to_prev /> (as you can when you use <txp:link_to_home />).

Advice? Thanks.

Offline

Board footer

Powered by FluxBB