Changing the order of 'links'
Seemingly a simple thing is very hard to do sometimes in Drupal. One thing is to change the order of node's links. For example, the main page lists node's teaser, where each node teaser is followed by links like "Nobu's blog", "Add new comments", and "Read More".
For readers, it may be natural to continue to read by clicking 'Read More'. Since 'Read More' is NOT the first link, one may be mislead that there's no contents for the node. To avoid this, I wanted to show "Read More" immediately below the teaser, not as part of many links.
To do this, you need to implement a hook function. In theme's folder, you find template.php. If not, you need to create one. In the file, I implemented the way to show "Read More" first, then rest of the links.
function phptemplate_links($links, $attributes = array()) {
//do whatever to links here
$my_links = array();
// Take out 'Read More'.
if(isset($links['node_read_more']))
{
$my_links['node_read_more'] = $links['node_read_more'];
unset($links['node_read_more']);
}
// Show the 'Read More' first.
$theme1 = theme_links($my_links, $attributes);
// Then, the rest of links
$theme2 = theme_links($links, $attributes);
return $theme1 . $theme2;
}
Depending on the theme, you may want to change attributes so that you can show using different style in CSS.
