(Tutorial) Adding A Permalink
Drupal : Adding A Permalink
Adding A PermalinkI got the idea for today's post after I received an e-mail during the week from Colin who was wondering how I added a permalink, and then styled the links section so that everything (comments, read more, permalink etc.) lines up.
I thought this might be of general interest, so here's the answer.
It's basically just a two step process:
- add some markup to the node.tpl.php file
- add some css to the style.css file
Step 1 - Add markup to the node.tpl.php file
To start with I just added some markup to the links div, and then positioned the whole links div at the end of my node.tpl.php file, right before the closing node div tag.
<?php if ($links): ?>
<div class="links">
<p class="permalink"><a href="<?php print $node_url ?>" title="Permalink to this my Drupal blog post">Permalink</a></p>
<?php print $links ?>
</div>
<?php endif; ?>This positioned the permalink within the links div before the other links.
Courtesy: Mydrupalblog.lhmdesign.com
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)