Hi All,
I encountered a problem with custom pagers when i converted all the page nodes into panel page using node template panel available in the panel module. . . By doing this i cant get the custom pagers previous and next content in my viewing page. Even if I select node type to both panel and page, it doesnt seems to work. I think this is a bug or a issue with the custom pagers. . .
function custom_pagers_preprocess_custom_pager(&$vars) doesnt seemed to be called.
function custom_pagers_preprocess_custom_pager(&$vars) {
//print_r($vars);
exit();
drupal_add_css(drupal_get_path('module', 'custom_pagers') .'/custom_pagers.css');
$node = $vars['node'];
$pager = $vars['pager'];
$nav = $vars['nav_array'];
$vars['previous'] = !empty($nav['prev']) ? l(t('‹ previous'), 'node/'. $nav['prev']) : '';
$vars['key'] = t('@count of @count_total', array('@count' => ($nav['current_index'] + 1), '@count_total' => count($nav['full_list'])));
$vars['next'] = !empty($nav['next']) ? l(t('next ›'), 'node/'. $nav['next']) : '';
$vars['suggestions'][] = "custom-pager-{$vars['position']}";
$vars['suggestions'][] = "custom-pager-$node->type";
$vars['suggestions'][] = "custom-pager-$node->type-{$vars['position']}";
$vars['suggestions'][] = "custom-pager-$pager->pid";
$vars['suggestions'][] = "custom-pager-$pager->pid-{$vars['position']}";
}
Comments
Comment #1
babycourageous commentedi know this is an old issue - but i too have come across this.
My custom pager works fine on node pages that AREN'T using panels to display. However, in my nodes that are using panels - nadda. any headway on this bug? I could really use the assist
thanks!
Comment #2
mattcasey commentedditto
Comment #3
asb commentedInteresting issue, but not critical. And, after two years without a maintainer's response, probably a "won't fix".
Comment #4
asb commentedI've tried to reproduce this isse, but custom pagers work fine within Panels, at least if the pager has been properly set up.
Please give more specifics about your system: version of Drupal core, panels, ctools, etc.; maybe an export of your override might help as well.
Comment #5
mattcasey commentedWell, some good news. The pager shows up in the node template panel when I enter a PHP snippet under Pager node list. I think it's something with my View not being returned or set up properly. When I dd() the $result, it only returns an array of the sort values used: 'created_date' instead of 'nid'
Using a PHP snippet for the node list, I can get pagers to show up in panels when I add the block or if I add 'Node: content' (Node:body doesn't work). Uncheck 'No extras' and set Build mode: 'Full node'
I'm using Drupal 6.12, Ctools 6.x-1.8, Views 6.x-3.x-dev, Panels 6.x-3.9 and Custom Pagers 6.x-1.x-dev
Comment #6
mattcasey commentedI can also use my view by calling it in the PHP Snippet area (it does not use grouping):
It's just when I try to use the view through the UI, the Nid's are not returned.
Comment #7
jckeme commentedHello, I was able to find a way around this using a couple of modules (Panelizer alongside the panels module and the flippy module used for adding next/previous link on a specific content type) while working with drupal 7. I'm not sure if this issue has been resolved yet, but this is still a suggestion on how to solve the problem. Here are the steps i took.
Step 1) Install the modules (flippy, panelizer and panels)
Step 2) Create a new content type. (Please note that while using the flippy module, the "next/previous" links can only be placed based on specific content type. This is the reason for creating a new content type. If this feature does not suit you, you may try the "custom-pager" module although I didnt try it since it didnt suit me.
Step 3) Go to Configuration>Panelizer and panelize the newly created content type by clicking all its check boxes by the side of that content type.
Step 4) Now you have panelized this content type, you can then create a new panel page based on this content type. Go to create new content, create a new content based on your created content type, and enable the "flippy" checkbox and configure it to your desire. Save this new content type ( I added a menu link to it so i could access it easily)
Step 5) Go to your newly created content, and edit the panelizer feature just as you would do for your panel page. THERE YOU HAVE IT, A PANEL PAGE WITH PAGER FEATURES. For more features, you can also delete some of the page content that you may not require to show on your newly created panel page.
(Caution!!! If you delete all the default content on that page, the pager links will disappear. To get them back, add a new content to your panel region on the page {a Node Content}, and ensure you uncheck the "No extras" checkbox to re-enable the pagers done by the flippy module. Also remember that you'll require more that one published content of this content type for this to work)
Comment #10
danlinn commentedFWIW, I came across this issue, but ended up using a different solution. I was already using display suite to create custom displays, but I suppose this would also work with the teaser view if it's not being used elsewhere:
1. Create a new display type in the Display Suite (DS) settings called pager only
2. Add the display to the content type
3. Move all fields in Manage Display for pager only to hidden
4. In your node page override panel add the node content item under node and choose your pager only display. Make sure you uncheck the "No extras" checkbox.
Hope this helps someone else!