This is a beta support for paging (splitting long page nodes into smaller chunks) using a <!-- page --> tag.

Even in this beta stage it works flawlessly in my drupal 4.6.3.

Preview of splitted nodes is broken without some other hacks; I'll provide them as patches if this feature request is deemed interesting.

Comments

lennart’s picture

I find this to be an important and interesting feature!

Best wishes,
Lennart

scutari’s picture

StatusFileSize
new692 bytes

I'm very happy it's useful!

With this additional patch (it's against node.module) the <!-- page --> tag is changed to <!-- pg --> in node_preview so that paging is not triggered. The whole page in displayed instead.

Yes, it's a dirty hack, and comments are welcome if anybody knows how to do it in a clean way.

Regards
Marco

sgwealti’s picture

The onion website just switched to drupal and they seem to have a pretty good pager for their nodes. I wonder how they did it.

Bèr Kessels’s picture

IMO this really needs to live in a module.

scutari’s picture

It can be done in a module using a couple of hooks, but in my opinion it's overkill for such a small change. I think the proper place for such a feature is core.

A new core module may be fine, too, but I would like to hear some other comments before I
make up my mind.

robertdouglass’s picture

It would need a menu item to intercept the node/nid/pagenumber param, and a filter to split the pages at a configured length. Ber is right that this should start out as a module, and then when it has proven itself, get integrated into core. I definitely want to see it happen but won't get around to programming it myself anytime soon.

robertdouglass’s picture

Has anyone considered asking The Onion if they would be able to share the code that does that? It might be that they wrote custom Drupal code just for the purpose. Seeing as they are using Drupal to make one of the best looking news sites on the web, they might be receptive to giving back to the community.

tostinni’s picture

Has anyone considered asking The Onion if they would be able to share the code that does that? It might be that they wrote custom Drupal code just for the purpose. Seeing as they are using Drupal to make one of the best looking news sites on the web, they might be receptive to giving back to the community.

I wrote them yesterday and I hope they would give us some feedback. Their site is looking very good and integrate very well some contributed and custom module.

Regarding pagination, I foud this link a while ago, I don't know if it works, but might worth the glimpse : http://drupal.org/node/23362#comment-43694

Prometheus6’s picture

Regarding pagination, I foud this link a while ago, I don't know if it works, but might worth the glimpse : http://drupal.org/node/23362#comment-43694

It works...I'm the guy that told him how to do it.
http://drupal.org/node/23362#comment-40754

It's so easy I honestly thought it was left out on purpose.

scutari’s picture

StatusFileSize
new1.99 KB

Ok, that's a paging module based on my first patch (it does not fix the preview bug).
I think I'll be able to include my preview fixes (those in the second patch I sent) before this weekend.

I reverted the first patch on my drupal site, and used the paging module instead with good results.

Regards
Marco

Stefan Nagtegaal’s picture

Could someone post an url to "The Union"?
So others could see what you guys mean?

Steef

tostinni’s picture

I wrote them yesterday giving them this link : Is the Onion using Drupal?
Till now, I didn't have any response, so I will let them a little more time and hope they will respond.

I used their contact form, if anyone knows a better way to contact them, go ahead.

eafarris’s picture

Stefan:

they're talking about www.theonion.com, one of, if not the, premiere humorous "fake news" sites on the 'net. And, sure enough, the html head shows the link to misc/drupal.css. How exciting! This needs promoted.

scutari’s picture

StatusFileSize
new2.24 KB

Updated version of paging.module:

* fixed typo in the description.
* the patch no node.module is not needed any more.

Still TODO:

* node/nid/pagenumber param.
* split the pages at a configured length.

Tested on my site and is seems to be working.

Regards
Marco

chx’s picture

Version: 4.6.3 » x.y.z
Component: page.module » base system
Status: Needs review » Needs work

1. 4.6.3 and feature request? Features go in HEAD.
2. As it was said this module need to live on its own, it has nothing to do with core ATM

I feel tempted to remove this from the patch queue.

scutari’s picture

If you think that either there's still work to be done or more testing/integration is needed, I agree with you. I'm sorry I forgot to change the feature request's status, but it's my first contribution.

The code, on the other hand, works (in its original form) on the site I'm building (still not on the web, sorry) since april, and I will write a decent help page soon.

A question: what's the reason why node/nid/pagenumber is needed?

Thanks a lot
Marco

scutari’s picture

StatusFileSize
new2.55 KB

New version of paging.module:

* major cleanup (less hardcoded HTML).
* code now has comments.

Regards
Marco

Stefan Nagtegaal’s picture

Scutari, I'm sure the drupal community does stimulate your work and thank you for your time in this, but the 'Patch queue' is not for uploading modules in the way you are doing here..

I encourage you to move the development of your module from here to the 'Drupal Contributions Repository'.

Some links which are interesting for reading about contributing to drupal:
- Contributing to Drupal;
- You should ask a CVS Account;
- Because you are a module devloper right now, you should read the module developers guide;

Keep up the good work, only in contributions instead of here... ;-)

Yours sincerely,

Stefan Nagtegaal

scutari’s picture

Status: Needs work » Closed (fixed)

You're right, my feature request in not a patch any more.
That's the reason why I set the status to "closed"; I will apply as a module contributor as soon as possible.

Thanks for the advice
Marco

tostinni’s picture

Thanks a lot for your work, I will have a look at, it's a long time needed feature.

scutari’s picture

Component: base system » other
StatusFileSize
new5.07 KB

That's a fairly rewrite of the patches above; I added support for viewing the whole page (using node/nid/all or url/path?chunk=all) in the process.

{Comments,Opinions,Remarks} are welcome as usual.

tostinni’s picture

Would you mind to apply for a CVS and put this in a contrib module, it would be so easy to find/review/patch...

Uwe Hermann’s picture

Status: Closed (fixed) » Active

This is not really closed, it seems.

scutari’s picture

StatusFileSize
new5.07 KB

I closed my own feature request because, well, was not a patch to the base system any more.

But if you think the right status to let people discuss here about paging is "active", so be it.

venkat-rk’s picture

Sincere thanks for this effort, but did you look at (and possibly integrate) Promotheus' pagination module to avoid reinventing the wheel? Sorry I am not a programmer, so feel free to correct me.

scutari’s picture

I did indeed look to Promotheus' pagination module ... after reinventing the wheel!
I copied some features I had not implemented at the time, however.

scutari’s picture

Status: Active » Closed (fixed)
StatusFileSize
new5.01 KB

Since I really have no time to submit this module, I'm attaching it (final version) and closing this thread.

merlinofchaos’s picture

I created a module Paging for this project.