I want to have access to the next element in the pager $nav_array['next'] from the node.tpl.php
I can't reach $nav_array from it. only from custom_pager.tpl.php

is it possible?

CommentFileSizeAuthor
#4 cust-pager-navarray.diff2.24 KBbleen

Comments

botris’s picture

sub

Toxid’s picture

I also want this.

halefx’s picture

subscribed

bleen’s picture

Title: $nav_array['next'] in node template » Include nav_array in custom pager object
Status: Active » Needs review
StatusFileSize
new2.24 KB

... More generally, the entire nav_array should be available. Consider the following case:

I have a photo gallery using a custom pager or the next/prev buttons. Then my client come to me and says "hey, I want the gallery to move to the next photo when a user clicks on the actual photo."

The attached patch makes the entire nav array available in node.tpl at $custom_pagers[3]->nav_array where 3 == the custom_pager id...

Toxid’s picture

Thanks, clicking on the photo to move to the next photo was what I had intended. I will try the patch now.

EDIT: I could not get access to $nav_array. It's still empty when I run it through print_r.

bleen’s picture

Re: Toxid ... because a node could be part of many many many pagers I could not include a simple $nav_array variable (because which nav array would be there?)

Try print_r($custom_pagers[0]->nav_array) and see what you get. Using this method, each pager can have its unique nav_array available...

Toxid’s picture

Status: Needs review » Reviewed & tested by the community

Ah, I see now that you wrote it in the post with your patch, sorry I missed that. It works as you described :)

bleen’s picture

bump ... would *LOVE* to see this committed :)