2

I'm working on a website which features a daily updated "six word story" (a node for each day). I created a view to display the last node/story, with the option to scroll back one day at a time (using AJAX). The view has a full pager.

However, the pager is (of course) displaying "<< Previous ... 2 ... Next >>". Number 2 would mean "yesterday" (the first result is today's six word story, nr. 2 yesterdays and so on). What I want to do is alter the text (which now is just a number), so it would show the post date of the shown node/story.

I know that the labels can be altered, but there are only four labels (first, previous, next, last). It seems that there is no label in the pager plugin for the current page. Any ideas on how to alter the label without breaking the actual pager itself?

0

One thing that comes to mind is to override theme_pager() in your theme's template.php. In fact, this post covers how to do that without messing up the first, previous, next, last labels.

  • You are a lifesaver! I ended up using the theme_pager code in the link. Since I found no way of accessing the view itself from the theme_pager function, I created an EntityFieldQuery to mimic the view and get the active node id. That way, I could access the node's created property. – UliKonkel Jul 11 '15 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.