views:

35

answers:

2

In my Drupal 6 installation, using the standard Content Translation module, links to translated versions of a node is added below the content.

How do I output those links another place in my theme?

To be more precise, I would like to output the links (if there are any) in my right toolbar.

Thanks, Egil.

+1  A: 

In most themes, those links are just called $links in your page.tpl.php, so you can just move $links to your right sidebar instead of where they are now in your page.tpl.php.

However, that has the added pitfall of also moving all other links with them (such as "add new comment", "read more", etc.), so to fix that you'll have to do some funky stuff in template.php (THEMENAME_preprocess_page() specifically) that basically removes the translation links from $links and outputs them as a separate object (something like $translationlinks), then put THAT where you want it.

Mike Crittenden
A: 

create block with php filter:


$node = menu_get_object();
if ($node->links) {
  print theme('links', $node->links);
}
Nikit
Will that not move all the links? I only want to move the translation links.
Egil Hansen
Investigate $node->links by print_r, you will wonder...
Nikit
It would be much easier and cleaner to just move $links in page.tpl.php if you're going to go that route.
Mike Crittenden
@Mike: yes, that was what I thought. $node->links has both translation links and other links like statistics.
Egil Hansen
it doesn't matter page.tpl or block...
Nikit

related questions