10. Adding a 'more' link and showing all entries

We now have a function that creates a page with all the content created a week ago. Let's link to it from the block with a "more" link.

Add these lines just before that $block['subject'] line. These lines will add the more link to the end of the $block_content variable before saving it to the $block['content'] variable:

<?php
// add a more link to our page that displays all the links
 
$block_content .=
   
"<div class=\"more-link\">".
   
l(
     
t("more"),
     
"onthisdate",
      array(
       
"title" => t("More events on this day.")
      )
    ).
"</div>";
?>

This will add the more link to the block. Note the extra parameters used in the l() function. You can add additional values, such as 'class', in the array to customize the link.

More information on the l() function:
Drupal HEAD

 
 

Drupal is a registered trademark of Dries Buytaert.