Recent changes cause some headaches - Maybe some help

Jason Ruyle - March 6, 2009 - 01:20
Project:Pagination (Node)
Version:6.x-1.5
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I'm running pagination on a node type "article" and had quite a bit of customization.
After upgrading my page broke in a bad way, I was hoping someone might be able to help resolve the problem. I was able to fix some of the problems.

I had been loading my content with:

$node->content['body']['#value'];

And the pagination was loading with it, but after updates, the pager wasn't loading with this. I ended up adding:

<?php print $node->content['pagination_pager']['#value']; ?>

Right after that, and it now works.

My second issue, which I can't figure out is how to load my graphic from imagecache on only the 1st page.
I was running this code.

<?php $photo = $node->field_photo; ?>
<?php if ($photo): ?>
<?php
  $getpage
= _get_page_var();
  if (
$getpage === 0) {
    print
$fieldPhoto;
  } else {
    print
'';
  }
?>

<?php endif; ?>

It had been working, but all of a sudden it was causing major problems. It was saying that _get_page_var(); is not a defined function. Does this have something to do with me not getting the pagination from the body content anymore, but having to redeclare it?

Any help would be greatly appreciated.

#1

mundanity - March 6, 2009 - 04:33

Hi there,

The internal structure of pagination has changed as of 1.4, if you want access to the old _get_page_var() function, change your code to:

<?php
    $pg
=& Pagination::getInstance();
    if (
$pg->getPageVar() == 0) {
   
// etc...
   
}
?>

#2

Jason Ruyle - March 6, 2009 - 15:45

Thank you for the help. The code help me resolve the problem and the sites looking good.

#3

mundanity - March 9, 2009 - 02:17
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.