In Drupal you should know that you never want to hardcode a local URL into your nodes or blocks. Firstly as your site expands the node may show from places you do not currently imagine thus breaking your paths. Secondly if you try to bypass this by using a full/direct URL, you are going to be up shit creek without a paddle when you migrate the URL. The link l() function should be used for adding links so that manipulations, like localization and URL determinations, can happen on the output.
Below are some of examples of creating links in drupal using the l() function:
<?php echo l('Pancakes, the Sunday Stacks', 'node/447', array("title"=>"Cooking Pancake")); ?>
<?php echo l('norml.org', 'http://www.norml.org/index.cfm?Group_ID=3374', array("target"=>"_Blank", "rel"=>"nofollow")); ?>Use your knowledge wisely. Peace out.
Komentáře
Poslat nový komentář