Customizing "View More" Links In Views 1 For Drupal 5

Submitted by Bevan Rudge on August 20, 2008 - 12:55am

A short, quick and easy tip for views theming and customization.

To customize the text or the destination path/url of a 'view more' link in Views. Add this to template.php in your phptemplate theme and add cases.

<?php
/**
* Override theme_views_more() to set custom link texts and destinations.
* @param $path String
*   The destination of the more link.
*/
function _phptemplate_views_more($path) {
 
$text = 'more';
  switch (
$path) {
    case
'foo/bar':
     
$text = 'doh';
      break;
  }
  return
"<div class='more-link'>" . l(t($text), $path) . "</div>";
}
?>

Views 2 for Drupal 6 lets you do this in the UI.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Submitted by djkim (not verified) on March 17, 2009 - 10:59am.

Views 2 for Drupal 6 lets you do this in the UI.

Really?

That would be new to me. I think the only way with Views 2 is trough views-more.tpl.php

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <p> <a> <em> <strong> <cite> <ul> <ol> <li> <dl> <dt> <dd> <img> <b> <i> <h2> <h3> <pre> <br> <font> <hr> <s> <strike> <code> <span> <blockquote> <acronym> <del> <ins> <table> <th> <tbody> <tr> <td> <div>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options