Closed (works as designed)
Project:
Insert View
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2011 at 04:55 UTC
Updated:
6 Jan 2012 at 00:34 UTC
It stumped me for a while, but views that I was inserting, that had pagers, were overriding the default search pager. I eventually added code into a custom module to prevent them from being inserted on search pages. This is my code below, but any improvements or suggestions are welcome.
function MODULENAME_node_load($nodes, $types) {
if(arg(0) == 'search' && arg(1) == 'node') {
foreach($nodes as $key => $node) {
if(isset($nodes[$key]->body['und'][0]['value'])) {
$nodes[$key]->body['und'][0]['value'] = preg_replace('/\[view:[^\]]*\]/', '' , $nodes[$key]->body['und'][0]['value']);
}
}
}
}
I'm not sure if there should be some change in the module to do this better either. Feel free to close this issue if not.
Comments
Comment #1
pasqualleyou can have multiple pagers on the same page, just change the pager id on the view edit page
Pager ID description:
this is not a bug in insert_view, it is how multiple pagers work..
Comment #2
burgs commentedThanks Pasqualle,
The optimal solution would be to set the search pager to be the second pager, so that all the inserted views pagers didn't have to be. Search isn't that flexible though. Anyway, the slight hack is there for people who need it.