Attached is a new paging module that supports filters and CCK. By supporting filters, you can now enable or disable the paging based on input format (in admin / filters). I believe that this is the "Drupal way" rather than install something that always works on all nodes.

I've also added a setting so you can change the page break from <!--pagebreak--> to anything you want, primarily so that this module can be used with tinymce, and the pagebreak string can be changed to something that tinymce will output, such as <HR />.

A previous CCK patch was posted that I couldn't get to work. I've included a CCK patch that worked for me, here.

It would be nice to have a more generic solution, one that replaced all $node fields that had the paging input format enabled. I have not done this yet. The solution is to loop through the node fields looking for ones that are paging filter enabled, look for body and teaser fields specifically using preg_match(), match up body's and teaser's that go together, then run them through the work functions. All the matching work should be done one time, probably in load. I think this solution would catch flexinode nodes, however I haven't looked at the flexinode format close enough to know for certain.

Comments

douggreen’s picture

Category: task » feature
Status: Active » Needs review
StatusFileSize
new6.06 KB

This version displays the current paging separator in all of the help messages, and fixes a couple of comments that referenced the wrong module.

jax’s picture

Your patch doesn't apply to the module you attached originally. Could you provide a module with all the functionality? It would be easier to test, since now I cannot test it with the patch in it.

jax’s picture

There is at least one bug in the thing:

  } else {
    _paging_nodeapi($node, $node->body, $nody->body,
                   $node->teaser, $node->teaser, $op, $teaser, $page);
  }
}

function _paging_nodeapi(&$node, &$nodebody, &$nodeteaser, $op, $teaser, $page) {

$op is sent as 6th arg and _paging_nodeapi expects it as 4th. So you cannot even try this out...

btw, the patch is against the original module in project/paging, not the one presented here as I said in my previous post. If douggreen does not react I'll try to provide something that can be tested...

jax’s picture

StatusFileSize
new5.16 KB

Attached to this post is the paging.module from http://ftp.osuosl.org/pub/drupal/files/projects/paging-cvs.tar.gz with the paging_0.diff patch applied and the bug-fix described above. It seems to work.

Don't forget to activate the filter through:
administer > input formats > configure > check the Paging filter.

Gurpartap Singh’s picture

StatusFileSize
new7.01 KB

Here's a patch with following new features:

  • Support for CCK.
  • Use Input Filters.
  • Custom paging string.
  • Enabled for specific content types.
  • Optional teaser "read more" linking to next paging page.

Paging with this patch seems to be at little next level. Thanks to douggreen, Nick Lewis, and Jax for the fixes :)

Gurpartap Singh’s picture

Status: Needs review » Reviewed & tested by the community

Marking RTBC. Seems working good. Will be commiting soon.

Gurpartap Singh’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS. For any further problems, please create new issue against the project.

Anonymous’s picture

Status: Fixed » Closed (fixed)