[support] How to override term links rendering

Dale McGladdery torelad at gmail.com
Thu May 28 16:44:51 UTC 2009


The value of $terms is generated in the theme layer so it's
appropriate to modify it there. Check out:
http://api.drupal.org/api/function/template_preprocess_node/6

First, a $taxonomy variable is created with: $variables['taxonomy'] =
taxonomy_link('taxonomy terms', $node);

The value of $terms is created with: $variables['terms'] =
theme('links', $variables['taxonomy'], array('class' => 'links
inline'));

Check out the theme_links doc
(http://api.drupal.org/api/function/theme_links/6). If you can't add
your CSS the way you want to using the $attributes parameter, you'll
need to create a custom function.



On Wed, May 27, 2009 at 4:55 PM, Daniel Caillibaud <ml at lairdutemps.org> wrote:
> Hi,
>
> Hi want to add some own css class in taxonomy terms links (depending on vocabulary), and change links order (depending on
> vocabularies too).
>
> "How?" is the question!
>
> - link_alter hook doesn't seem to be the right place because I don't find any param to add css class, and it doesn't play with
> links order.
> - it's possible to modify $terms html string in the preprocess_node function (in template.php), but it's doesn't sound like a
> clean way...
>
> I'll apreciate any clue  ;-)
>
> --
> Daniel
>
> Si l'intelligence artificielle fait une connerie, c'est pas grave,
> c'est une connerie artificielle.
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>


More information about the support mailing list