Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
New release of 5.x-1.7 improves in theme, also great to be compatible with CCK contemplate.
Compared with previous versions, 'Next' and 'Previous' , instead of node titles, are used for navigation. So, is it possible to give an option to select node title or next/pre?
Thanks again for this great module.
Issue fork custom_pagers-123690
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
eaton CreditAttribution: eaton commentedI'm taking a look at providing customizable output options for the module -- ie, a field into which you can paste your own HTML for output. The reason the 'default' pager style was simplified was speed: using this option, it's not necessary to do a full node load on both the previous and next nodes.
Comment #2
BradM CreditAttribution: BradM commentedJust wondering if anyone can quickly explain a temporary solution? I'd like the previous and next node titles to show up, rather than the default "previous" and "next" text.
I checked out the readme.txt file but I am completely lost. I created a function phptemplate_theme_custom_pager($nav_array, $node, $pager) and placed it within my template.php file, in order to customize. It mentions somewhere to use node_load(), but the only examples I could find were like this: $node = node_load($nid) -- however I can't see how that can be placed within this modified function anywhere.
Great module btw!!!
Comment #3
wayland76 CreditAttribution: wayland76 commentedClosed the duplicaate node linked below, which had some useful discussion.
http://drupal.org/node/185980
Comment #4
MichelleUntested, but should work...
Michelle
Comment #5
lomz CreditAttribution: lomz commentedWhere do I place this code?
Comment #6
BradM CreditAttribution: BradM commentedI've finally managed to get this to work. However, I had to modify custom_pagers.module directly; I couldn't get the code to work just by putting it in the theme's template.php file.
So, if you're feeling brave, edit your custom_pagers.module file, and replace the entire
function theme_custom_pager
with the following:Important! Then add this function after it:
I suggest trying this on test site first -- I copied this from my file and removed some extra comments and minor modifications but the code should work as shown.
Brad
Comment #7
xaryss CreditAttribution: xaryss commentedI am still not having any luck with this either. Brad, your example did not seem to work for me.
Any other suggestions or instructions I can use?
Comment #8
BradM CreditAttribution: BradM commentedSorry, off of the top of my head, I don't. The code works at my site. When you said it didn't work for you, was there any change at all when you added this code? Since you're modifying the module file directly, you might also want to make sure the same function does not appear in your template.php file. Other than that, I'm not much of a coder so I can't think of what else to try.
Comment #9
asak CreditAttribution: asak commentedI tried using the code from theme_sample - but getting odd behavier:
Title pagers are not displayed when on the last node in the count.
I can see the pagers on nodes with "1 of 3" and "2 of 3" but not on "3 of 3" ... ?
Thoughts?
Comment #10
mattcasey CreditAttribution: mattcasey commentedTo replace 'previous' and next' with the node titles, create a custom-pager.tpl.php file in your theme folder:
Comment #11
13rac1 CreditAttribution: 13rac1 commentedClosing this three year old issue... ;)
Comment #12
areikiera CreditAttribution: areikiera commentedI think this is very helpful code, and I've edited it a little bit because I was receiving a non-object error on the first and last nodes. I think this may need to be updated a bit (for D7) and would really appreciate any feedback!
Thanks!
Comment #13
gratefulsk CreditAttribution: gratefulsk commentedWorks great! Thanks areikiera