Sorry, long title.

Some themes require that a pager should be output above and/or below the content.
Other themes (like my current) may be so complex that a themer wants to output the pager(s) at custom positions in the template.

Attached patch adds a configuration setting to choose the pager position and automatically assigns the pager HTML output to $node->paging.

I didn't want to create three other issues for three additionally included minor fixes in this patch:
- $form['paging_config']['paging_separator'] should be a required form element.
- Missing break in hook_nodeapi('view'), which is actually important for this patch, resp. the next point.
- Argument $element for theme_pager() should not use an arbitrary pager id, but ensure to add a new pager id for each full node view that is displayed (Remember that you can output more than one full node using Views and/or Panels).

CommentFileSizeAuthor
paging-DRUPAL-5.position.patch2.86 KBsun

Comments

tflmike’s picture

Hi Sun-

I just added this patch to my paging 5.x-1.x-dev module and I'm excited to put it to use! I just had a quick question...

When I first installed the module (in place of my working paging module) at first I noticed that even though I set up the pager, I was still getting all my body text. The code I was using to output the body text was: <?php print $node->content['body']['#value'] ?>

At first I was able to solve this by change my php call to: <?php print $node->pages['0'] ?> (which only shows the content of the first page) but then even when I click on the pager #2, I still get the content from page #1 (because I'm calling that specific part of the array by using $node->pages['0']).

So I was wondering if you might know how I could call the text from my body field, only have it display the content from that one page, and then change accordingly as I click/load another page using the pager?

Thanks a lot!

Gurpartap Singh’s picture

Looks simple and good for Drupal 5. You may want to use 'Disabled'(first option) instead of 'Not output', defaulting to 'below'.

Also, for Drupal 6 version, I would like to first work out the page names feature and include some more pager theme functions, similar to other forum softwares, and existing websites like http://www.hexus.net/content/item.php?item=12294&page=2 , etc.

tflmike’s picture

Hi there! Thanks for your reply.

You response was a bit confusing though... I currently have the patch installed and my current paging settings are:

Separator:
<!--pagebreak-->

Position of Pager:
Below content

Automatic Paging:

By line break:
   Length of each page: Disabled

By words:
   Length of each page: Disabled

Basically the issue I'm having is that when I have paging turned on (with the patch) I can separate my pager, but when I try to print out my body field using <?php print $node->content['body']['#value'] ?> I get all the text (as opposed to just the text for page 1).

When I use the paging module without the patch, it's works fine. The only issue is that the pager is combined with the body field and I want to have it separate so I can theme it differently. So this patch is exactly what I'm looking for except that now I get the entire text in my body field as opposed to just the text on page 1, page 2 etc...

So do you think my paging settings might be causing this issue?

Thanks!

Gurpartap Singh’s picture

Hi,

I had replied to the original post by sun. As you are trying to print, it'll break another issue where search indexes your pager(next previous last links). I think you should make another issue for the problem you are facing, or search for an existing similar one. :)

Thanks!

tflmike’s picture

Right... Normally I would make another issue, but since this has to do with the patch which Sun put out, I thought this would be the most appropriate.

Any thoughts about how to help my above issue?

Thanks!

Gurpartap Singh’s picture

Status: Needs review » Fixed

Committed all the changes to 6.x and 5.x branches.

http://drupal.org/cvs?commit=166596

http://drupal.org/cvs?commit=166597

Gurpartap Singh’s picture

Argument $element for theme_pager() should not use an arbitrary pager id, but ensure to add a new pager id for each full node view that is displayed (Remember that you can output more than one full node using Views and/or Panels).

The suggested change doesn't actually work. I have reverted the commit for those changes.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.