Download & Extend

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

Project:Custom Pagers
Version:5.x-1.7
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

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?

Comments

#1

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

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

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

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

Status:active» closed (duplicate)

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

nobody click here