Displaying node titles instead of "previous" and "next"

sambtaylor - October 23, 2007 - 20:36
Project:Custom Pagers
Version:5.x-1.7
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

How can you have custom pagers display the titles of the previous and next page instead of just saying "previous" and "next," i.e. as with the Forum built in function?

#1

florianr - October 28, 2007 - 20:34
Version:5.x-1.x-dev» 5.x-1.7
Component:Code» Miscellaneous

I am also looking for a solution. I found the documentation talking about that, but I have no idea how to reallize that.

Perhaps someone has a usefull snipet?

Thanks

#2

liamgh - January 20, 2008 - 16:59

I found the answer to this in the file "theme_sample.php" which is part of the download. This provides a useful theming function that displays the titles of the nodes rather than page numbers. There is a slight overhead though that it has to look up the names of the titles. Hope this helps.

#3

xentek - January 23, 2008 - 17:27

The easiest way to work this is to copy the function from the theme_sample.php into the main module file, overwriting the one contained therein OR add it as an override functions in your theme files (may need to rename - drop the "my_" from the beginning of the function name).

#4

BradM - February 1, 2008 - 20:31

I couldn't get this to work in drupal 5.6.

I first copied the code in the example file into my template.php, renaming/replacing the function phptemplate_theme_custom_pager. There was no change at all.

So I then copied it into the template.php file as a new function, bluemarine_custom_pager. I then got a php error, the good old 'cannot use stdclass as an array'. The line in question was $prevttl = $prev_details['title'];

Can any of you guys who got it to work explain exactly what you did?

Thanks.

#5

wayland76 - March 18, 2008 - 11:25
Status:active» duplicate

This is a duplicate of http://drupal.org/node/123690 -- please continue discussion there.

 
 

Drupal is a registered trademark of Dries Buytaert.