I'd like to customize the styling of the "Add to favorites" and "Remove from favorites", but they have only a number in its class name ("class=0" and "class=1") not allowed by the CSS specification. It would be nice another name allowed by the CSS specification in order to style this two links with different icons with CSS.
Thanks!!

Comments

iub98’s picture

I wanna do the same thing. Have you found a way to do this?

ms2011’s picture

Category: support » bug
Status: Active » Needs review
StatusFileSize
new1.26 KB

Here's the right way to do it so you get a class you can theme, instead of a number. (see attached)

This patch will also make it so when you remove a favorite, you are redirected back to the node page the same as when you add a favorite.

chellman’s picture

StatusFileSize
new1.1 KB

I have another patch for this same issue. The solution's the same, but it seems to me that the convention for the classes is module_name + action, so I'm using "favorite_nodes_add" as the class for the add to favorites link (for example).

This patch is against the latest dev release (11/23/07).

Committing this will mean that hook_link_alter will work too, if needed.

chellman’s picture

Title: Class without numbers » favorite_nodes_link incompatible with hook_link_alter and unstylable

Since there have been a few stable releases since this issue was opened, I'm changing the title to something more noticeable (and, hopefully, accurate). It would be nice to see one of these patches get into the next release.

kbahey’s picture

Status: Needs review » Needs work

Patch does not apply. Please re-roll.

Also, please correct the code style (} else {).

chellman’s picture

Version: 5.x-1.x-dev » 5.x-1.2
StatusFileSize
new1.2 KB

Reroll? With pleasure. Thanks for checking back.

kbahey’s picture

Version: 5.x-1.2 » 5.x-1.x-dev

Still fails ...

patching file favorite_nodes.module
Hunk #1 FAILED at 268.
1 out of 1 hunk FAILED -- saving rejects to file favorite_nodes.module.rej

Please reroll against the DRUPAL-5 cvs tag, or against the 5.x-1.x-dev tarball.

chellman’s picture

StatusFileSize
new1.37 KB

One more once. Hopefully it will work this time.

kbahey’s picture

Status: Needs work » Fixed

Committed to 5.x-1.x-dev.

Should be in the tarball in 24 hours.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.