This is a simplified guide on how to set up Custom Pagers module, using Views 2 in Drupal 6 (however similar steps/concepts would apply for Drupal 5). For more advanced requirements, please refer to the main documentation page. If you are using Drupal 6, you must currently install the 6.x-1.x-dev version of Custom Pagers, as there is a serious bug in 6.x-1.10-beta1 (when used with Views, it only shows up to 10 items, no matter what).

Prepare an ordered listing of content

  1. The first thing you need to do is prepare a list of nodes (content) for Custom Pagers module to use (this is so it can understand which page comes after the page that's currently being viewed, which comes before it, and so on). Though Custom Pagers allows you to use PHP if you prefer in order to generate this list of content, the easiest way is with Views module (you can also use the SimpleViews module if you prefer, though its features are limited).
  2. Go to Administer > Site building > Views (admin/build/views) and click the "Add" link at the top.
  3. In most cases you will be making a Custom Pager in order to cycle through content of a specific type (such as Photos, Stories, etc). If so, choose a View name such as custom_pager_photos (where photos is the type of content). Enter a description and tag for your own reference if you wish, leave the View type as Node and press "Next".
  4. Click on the "10" link next to Basic settings > Items to display and change the number to 0, so that there is no limit to how many nodes will be displayed.
  5. Click the + icon on Fields. Change the Groups option to Node so that the list will be narrowed down. In the resulting list, put a check next to Node: Title, and press the "Add" button. Clear the content of the Label field and press "Update". (Note that Custom Pagers module does not work with a Row style of "Node". You must use fields as shown above). Custom Pagers module does not actually make use of the field added here (it only displays Previous and Next links), however you have to include at least one field to save the View. It may be possible to use this field with custom theming (see this issue).
  6. Click the + icon on Filters. Change the Groups option to Node so that the list will be narrowed down. In the resulting list, put a check next to Node: Published and Node: Type, and press "Add". In the resulting options, choose Yes for Published, and then for Node Type choose the type of content you want in the list (in the example, this is the Photo type).
  7. Press the "Save" button to save your View.

Configure a Custom Pager

  1. Go to Administer > Site building > Custom pagers (admin/build/custom_pagers) and click "Add a new custom pager".
  2. Choose a name to describe (for your own reference) what this Custom Pager will be for. You may want to name this the same as your View to keep things simple. Also choose your preferred Pager position. If you choose the last position option of In a sidebar block, you will also have to enable the block (which will have the same name as your Custom Pager) at Administer > Site building > Blocks (admin/build/blocks). You may also want to adjust the block's title to something like "More Photos" (or whatever your content type is).
  3. For the By node type setting, choose one or more Content Types you want the pager to be displayed on (this generally should be the same type you set up in your View). Ignore By PHP snippet unless you need it (refer to the module's documentation page).
  4. For the Use a view setting, choose the name of the View which you created earlier in this guide. Press the "Submit" button.
  5. If you'd like to disable the display of the number-of-number text, you can do so by customizing the module's template file. In the custom_pagers module folder, find the file called custom-pager.tpl.php and copy it into your own theme's directory. You can modify your copy of the file and it will override the default.

    Delete the line containing <li class="key"><?php print $key; ?></li> and save the file. In order for Drupal to become aware of your new template file, you have to clear the theme registry - the simplest way to do this is to simply visit the Modules page at admin/build/modules which automatically does this for you.

    Additional theming can be done by adding the .custom-pager class to your style.css file.

  6. View a node on your site of the type you configured a Custom Pager for, and the Previous/Next links should now have appeared, allowing you to cycle through all content of this type on your site.

Comments

geshan’s picture

I have figured out a non obvious solution to the problem, I have blogged about it here. Check it :).

Now you can have as many nodes you want not only 10 with views but in an indirect way.

Nipponina’s picture

Hi,

i used this module and it works well, but I can't set the view in order to show only the node that belong to the some term.

I need to do this because I use the module into a gallery and I'd like to show only the button next/previous to image the belong to the some category.

Someone can help me. I try to set the argument in the views to taxonomy: ID term (Taxonomy Term ID from URL) but it doesn't works.

Here there is the url of a page that use the module: http://www.sulgiappone.it/galleria/animali-giapponesi/akita-inu