views attachment and pager

View: New views
2 Messages — Rating Filter:   Alert me  

views attachment and pager

by Hans Langouche-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

anyone know how I can make a views attachment follow the pager of the
page it's attached to ?  My attachment is a gmap and supposed to show
the same nodes as in the page view (but on map ..).  This works for the
10 first results, but once going into the pager, the gmap stays on the
first 10 results (FYI setting the display to HTML list has the same
problem).

I can't find any settings in the views ui and I was partially successful
by using a views hook and setting current_page = $_GET['page'], but it's
not perfect.  What I'm thinking now is take all the paging code from
view::execute and integrate it in my hook, but before doing that I was
wondering if there are any better approaches.

Tnx,

HnLn



Re: views attachment and pager

by Jennifer Hodgdon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Last time I used gmap with views, I ended up doing it within a custom
theming function for the view, rather than an "attachment" (not sure
what that is anyway) or a hook (ditto).

If you do it within a theming function, then Views passes your theming
function the list of nodes that are supposed to be displayed on the
current page, so you don't have to worry about the pager, queries, etc.

    --Jennifer

Hans Langouche wrote:
> anyone know how I can make a views attachment follow the pager of the
> page it's attached to ?  My attachment is a gmap and supposed to show
> the same nodes as in the page view (but on map ..).

--
Jennifer Hodgdon * Poplar ProductivityWare
www.poplarware.com
Drupal, WordPress, and custom Web programming