The attached patch includes the code I used to make automatic paging. It will automatically add the page delimiter to the node body.
The configurable settings are:
Automatic Paging (on/off)
Number of words per page.
The node types selected under the normal options are respected. During the submit phase of a node edit, the automatic code parses the body text adding the page delimiter to every 'x' word of the body, as determined by the settings.
I didn't know how people would want the settings, so for now automatic paginations override manual set page breaks. If desired, I can split the settings up further into a manual section with its node types, and an automatic section with its node types.
Please review and comment.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | paging_automatic_0.patch | 6.72 KB | Gurpartap Singh |
| #1 | paging_automatic.patch | 4.98 KB | Gurpartap Singh |
| paging.module.patch | 2.32 KB | Gman |
Comments
Comment #1
Gurpartap Singh commentedOther than improvements, there's a change in your concept of removing manual page breaks. Rather, if manual page breaks are present, paging would skip auto pagination. This is more flexible. Everything seems stable and was tested well under Drupal 5.1. Also option to select node types for auto pagination is added. Only node types which has paging enabled are selectable.
Needs review.. Have reviewed self, but a word from others is good :)
Comment #2
Gurpartap Singh commentedMoreover, breaking through sentences might not be desirable.. Maybe separator can be placed to the nearest line break(\n or
)? (If implemented, it should be optional from paging settings.)
Comment #3
Gurpartap Singh commentedPatch applies against paging-5.x-dev release.
Comment #4
danmurf commentedIs this still a patch or was this feature added to the latest development snapshot?
Many thanks
Dan
Comment #5
Gurpartap Singh commentedCommitted to CVS! Thanks!
Comment #6
psicomante commentedWonderful Gurp ;)
Comment #7
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.