I have a category module. I wirte function to create new category and my node(content) can choose its category from the new categories. Now I want a page to show categories. But there are too many categories in one page. Does drupal has any function to do the pagination?

Comments

ryivhnn’s picture

From someone who knows precious little practical knowledge on programming, you could maybe hook into something that does it? Coz I know drupal does pagination, anything with comments will paginate if it goes over the limit you set. Otherwise you could always look at comment.module and see if you can find how they do the pagination (I think it's comment.module unless they're hooking into something else to do it).

works at bekandloz | plays at technonaturalist

tom friedhof’s picture

Pagination is built in check out this link:

http://api.drupal.org/api/4.7/function/pager_query

hcamelion’s picture

Good question. I am wondering the same thing. The link above only provides a means for pagination in the query. How about outputing the actual pagination links. I may borrow the pagination class from codeignitor if Drupal doesn't have one.

tom friedhof’s picture

Menu callbacks that display paged query results should call theme('pager') to retrieve a pager control. Append that theme function to the output of your callback.

Check out this link:

http://api.drupal.org/api/file/includes/pager.inc/5