How do I create a multi-page content view in a node?

esend7881 - May 10, 2009 - 03:05

Hi,

I am brainstorming ways to display content as part of a page, but that content will have multiple pages.

The easiest example may be here: http://drupal.org/forum/4

Notice on the bottom of the page, you can go from pages 1,2,3,4, etc.

I am wondering what is the "Drupal way" of doing that?

Specifically, say I want to display Reviews on the bottom of a node, but I want to only display 2 at a time. What is the "Drupal way" of putting the multiple-page links below the reviews, so that when clicked, I go back to that same node page, but this time I am seeing Reviews 3 and 4?

In other words, say I have a node which (almost like comments) shows reviews. It is showing reviews 1 and 2. How do I make it so there is a multi-page button so when a user clicks "next" they will see reviews 3 and 4 while still on that same node page?

I hope this makes sense. One thing I should not, because of the set up I am on, I can't use the Views module. I will need to hard code it. So whatever drupal core functions exist, I'd like to consider it while I brainstorm this.

Thanks!

Book module?

cimo - May 10, 2009 - 03:45

Book module?

I meant what Drupal functions

esend7881 - May 10, 2009 - 04:12

I meant what Drupal functions can perform this type functionality...

I guess I can look through the book module.

Try the paging module. It

duvien - May 10, 2009 - 04:32

Try the paging module. It allows for using to split a node into several pages with a pager to display to skip to different pages. Or you could try using CCK node reference.

http://drupal.org/project/paging

Another one to try: http://drupal.org/project/custom_pagers

Oh well I didn't mean "split

esend7881 - May 10, 2009 - 08:14

Oh well I didn't mean "split a long post into several pages"

What I meant was this:

Take standard Drupal comments for example. You can have 50 comments on a page. Well what if I wanted to make sure there was only 10 comments per page, and the user needs to click "page 2" or "page 3" to go to the next pages?

Well in my case, I am not using comments, I am going to create a different node type. But I would still like to display it exactly like comments, but restrict it to only a few per page.

looks u are a newbie in

mm167 - May 10, 2009 - 08:48

looks u are a newbie in Drupal world and not speaking the drupal language very well.

let's re-phase your question and request.

For example, u want
1) allow your web site users to input local news one by one,
2) list out all the news, 10 new in a page, and with prev and next page links.

to do 1)
(as you already know) create a new content type and allow your user to build the content. i.e. one news one content page (or called node in drupal).

to do 2)
u may use views. http://drupal.org/project/views
in 1 line, "views" is used to help u to retrieve (of course, not limited to) content pages (nodes).
inside views, there is a feature called "pager". That's the paging feature as u are looking for.

hope the above info may be helpful to u.

welcome to Drupal World.

We go the drupal way. How about you?
http://www.drupalway.com

He said he can t use View

cimo - May 10, 2009 - 12:01

He said he can t use View

I get the sense you are a bit

esend7881 - May 10, 2009 - 19:29

I get the sense you are a bit condescending here.

But you didn't answer my question either way.

I can't use Views. Also, your #1 wouldn't work since what I am adding is almost like a block, not a full page. I want this multi-page content to be located on the bottom of an already existing node (sort of like comments).

*sort of*. that means not exactly like comments, but will appear like comments.

I was wondering if there is a standard drupal coding method to create a multi-page view? perhaps a function like drupal_render_multi_page($var1,$var2,...)

I'm guessing you are too newb to know that either :)

yeah you are right, good luck

cimo - May 11, 2009 - 15:10

yeah you are right, good luck

Comments are not a

cimo - May 10, 2009 - 12:03

Comments are not a (stand-alone) content type, comments can be added to any content type and you can choose how many you want to be displayed on each page, pager will come up automatically.

I know you said you can not

nevets - May 11, 2009 - 15:25

I know you said you can not use views but I wonder why?

That said, there is no standard way to do what you want. Since you are already hard coding it implies you already have a query to pull this other content type. It seems you should be able to use the pager functionality to achieve your goal. You would use pager_query instead of db_query then use theme('pager', ....) to output the pager.

Thanks for the pager tip! I

esend7881 - May 12, 2009 - 08:10

Thanks for the pager tip! I will look into it.

The reason I can't use Views is because the site I am working on took Drupal as a starting point, and really did most things by hand.

It was a company choice really, and hey, it has made me learn a TON about drupal. Though Not everything, hence why I ask questions still.

 
 

Drupal is a registered trademark of Dries Buytaert.