I like lemonade.

How to change the more link. Drupal Views Blocks

Share |

In Drupal 5.x with the Views module we can easily create content listing blocks. There is an option for switching on the "more" link on the Views edit page. If you would like to change the word "more" to something else, you can add the following code to your template.php in the theme folder:

/**
 * Override the more link on view block
 */

function phptemplate_views_more($url){
   return "<div class='more-link'>" . l(t('[Read more]'), $url) . "</div>";
}

Don't forget, that this function will override every "more" link on every block.
If you would like to theme only one "more" link, you have to come up with a better idea. Sorry :)

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <code> <img> <p> <br>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].

More information about formatting options