This is another simple little trick. I've gotten asked a few times how I got the URLs to display on my weblink entries. For an example look below the body of this entry:

See the little globe icon with the URL? It's easy to modify the node.tpl.php to conditionally format weblink entries. Just check for the node type using this code:
<?php
if ($node->type == 'weblink') {
print '<a href="/drupal-4-7-2/'. $node->url .'">'. $node->url .'</a>';
}
?>Simple, no? You can do that with any type, e.g. page, blog, poll, etc.
Update Weitzman (Moshe?) gave another nice alternative: "Copy node.tpl.php to node-weblink.tpl.php. Then you can customize fiull display of each node type." Even simpler!
Comments
01/11/06 @ 10:18
an alternative is to copy node.tpl.php to node-weblink.tpl.php. then you can customize fiull display of each node type
01/11/06 @ 12:35
Hey, that's an even better tip!
Post new comment