Is there any way that I could write the "more" link into my template.php views customization?

Comments

merlinofchaos’s picture

Status: Active » Fixed

Override this function:

function theme_views_more($url) {
  return "<div class='more-link'>" . l(t('more'), $url) . "</div>";
}
bsonnich’s picture

Thanks! This is close to what I want to do. For this specific block I'd like to

* have the "more" link say "View Gallery"
* write the more link into a table I've set up in function phptemplate_views_view_list_member_pics($view, $nodes, $type)

If I knew how to extract the nid I'm passing to the view, that would also suffice as a solution.

bsonnich’s picture

So, is there a way to write a customized "more" link into my phptemplate function?

merlinofchaos’s picture

See http://drupal.org/node/11811 for more information on overriding the functions.

For extracting the nid from the view, unfortunately this function doesn't take the view as an argument (sigh, it should; this is a design flaw, which is not exactly a bug, but...also not ideal).

What you can do is call views_get_current_view() which will get the view currently being worked on; and check $view->args to see what args were passed to it. That should be enough for most uses.

Anonymous’s picture

Status: Fixed » Closed (fixed)