15

Content type - article. I want to make articles split into multiple pages when the article itself becomes too long. For example if we have an article "how drupal works" it would be huge :), I want to split it to several pages and at some point you get "continue to page 2 of 10" and then "continue to page 3 of 10" and so on. Hope you got me and can share some ideas. Thank you in advance!

closed as unclear what you're asking by kiamlaluno Jul 13 at 5:13

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Related: Create a pager between fields. Probably some answers will be useful to you. If you will adopt one of them, post a self-answer here ;) – Mołot Nov 26 '13 at 12:55
  • @Molot, do you know a way to override the node default view with Views, then I can use views' default pager. This would be the most clean solution for me. – Ivan Ivanov Nov 27 '13 at 10:14
  • Just set views page's path to /node/% and use contextual filters (afair) to get proper node from it's nid in path. If in doubt, ask new question, just don't be surprised if someone will find out it was asked already. – Mołot Nov 27 '13 at 10:20
9
+50

I suggest split your text to some part with jquery and by scrolling you append(may with some effect like fadeIn .... ) another part to main part.
I suggest you achieve this job by jquery (client side solution)

  • That's how I implemented tabs on one of the pages I used to maintain. I must admit - works pretty well. It is really good idea to either output all pages and hide every one except first in js. And also implement #1 in url to determine what page user linked to. (My tab implementation is live here, sorry but I no longer own the copyright to JS code used). AJAX might work too, but on the other hand it's usually an overkill, ASCII compresses well and most time is used on initiating connection, not actual transfer, so it's a waste. – Mołot Nov 26 '13 at 13:14
  • Using ajax to load a simple job like fetch content(body) form database is not optimal job and it is a waste load on server,after this, not need to be very expert js developer by maximom 50 line code we can implement what I suggested,by the way I think the client side solution is the best solution for this job .tnx for you comment and discuss @Mołot:) – Yusef Mohamadi Nov 26 '13 at 13:41
  • Proper implementation of example.com/article/23#page-1 will take more than 50 lines. And it's worth to have it, so users can have permalinks directly to a page they want. – Mołot Nov 26 '13 at 13:50
  • I'd favor this solution as well - it's significantly more usable for people who get tired of waiting for the whole Drupal stack to load each page. It also allows for google to index the article as a single entity rather than search results potentially taking people to the middle of an article. I'd suggest checking on accessibility for screen-readers and the like, however - that could make this solution a little more complicated (though still the best solution IMO) – Nerdmaster Nov 26 '13 at 20:11
  • well, have done it at the frond end with several lines of jquery. I made the body field accept unlimited number of values(simulating different pages). Then just toggle btw display none/block. – Ivan Ivanov Nov 27 '13 at 14:03
9

You are looking for Smart Paging module

Provides splitting up long Drupal content into sub pages by number of characters/words or by a placeholder HTML tag for node, user and taxonomy term entities.

For Drupal 6

Paging module, you can set character limit and it will automatically split in to sub pages see the below screen shot

Break long pages into smaller ones automatically by words(or characters) limit

enter image description here

  • Thank you for your answer! I am working on Drupal 7 though. Is there such solution for D7? – Ivan Ivanov Nov 26 '13 at 13:05
  • Well, tried Smart Paging module it seems to do the job but it is uncompatible with Views AJAX pagers and in my case I am using such. – Ivan Ivanov Nov 26 '13 at 16:26
0

Well a workaround I would use would be to split it into multiple articles and combine them with a view-page (which has a pager) since you are working with views allready. Just filter out your articles on nid or some (hidden) tag. If you want them all to be the same max-size you could use https://drupal.org/project/maxlength. Add part X to title, this way its also easy for you readers to distinct the different pages.

0

I dont see what Views AJAX pager (which pages views result lines) has to with your article display (which is per se 1 result only). Two different things to page. But you might wish to output your "article content as a computed field". Start with a computed field that prints only the first x words of your article content field. (or up until the first page-breaker) Finish it off with a self-generated html "more link". That more link calls your view with an argument. You can use that argument in your computed field's PHP. Display the x-th part depending on your argument received.

  • Thanks for your answer! Issue #1103810, when enable Smart Pagging module it breaks down Views Load More(or Views Ajax Pager) module, so you cannot use both. That was I meant. – Ivan Ivanov Nov 27 '13 at 17:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.