Sorry for posting an compressed archive, but it's required in this case to ensure the proper placement of files inside of Paging module.

Attached patch along with the archive implements hook_wysiwyg_plugin() in Paging module. For now, this provides a Wysiwyg Editor (TinyMCE) plugin button to insert <--pagebreak--> tags into a content - without needing to copy or alter any files in the filesystem. By enabling Wysiwyg Editor and Paging module, the plugin is automatically loaded.

Comments

sun’s picture

StatusFileSize
new918 bytes

meh... d.o nuked my patch again

Gurpartap Singh’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Needs work

New features for Drupal 6 only. I would be glad to include this in the next beta if you can update with required changes!

bonobo’s picture

This, in connection with #503732: Page title compatiblity with WYSIWYG API, would make for a killer combination of features.

Very flexible, and very easy to use for non-technical users.

While this can be approximated by using the <hr /> button with text editors, this approach is cleaner.

jumpfightgo@groups.drupal.org’s picture

This is brilliant. Although I don't see a way for the plugin to know which break tag to use. If admin sets the break tag as

or


or something, then the plugin won't work... right?
ronan’s picture

Status: Needs work » Needs review
StatusFileSize
new952 bytes
new2.18 KB

Here is an rewrite of this patch which works with Paging 6, WYSIWYG 2 and is tested with TinyMCE 3.

The tarball should be expanded into the Paging module directory.

Hope this helps

murz’s picture

Status: Needs review » Reviewed & tested by the community

Thank's, works perfectly on Wysiwyg 6.x-2.0 and TinyMCE 3.2.4.1!

maebelater’s picture

Tested it with FCKEditor 2.6.5, works fine. Thanks.

cyberswat’s picture

This has been sitting around for a while and is RTBC ... when can we expect to see it committed?

smk-ka’s picture

No problems with WYSIWYG 2.x and TinyMCE 3.2.7. If there would be a status after RTBC, I would set it.

q0rban’s picture

#5 Worked for me.

pizzapotamus’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.1 KB

The plugin from #5 does not work with CKEditor because the name 'pagebreak' conflicts with one of the editor plugins that ships with the editor, so I've changed it to paging_pagebreak. I also changed the place holder element from an img to a hr tag. This does not appear to have any change in TinyMCE but as hr is a block element CKEditor will be sure to place it outside of any elements such as p or h1 thereby avoiding the opening and closing tags being on different pages.

For example with <p>1 2</p>
If a page break is inserted between 1 and 2 using an img as the placeholder you get <p> 1 <!--pagebreak-->2</p> resulting in no closing p on page 1 which admittedly is mostly likely not to cause problems(other than validation) as the content area will be wrapped in a div and the browser will auto close the p when it hits the end of the wrapper. However there will also be no opening p tag on page 2 which is more problematic for instance if you have specific styling applied to p tags.

By using an hr as the placeholder CKEditor will split the p element in two and generate <p>1 </p><!--pagebreak--><p>2</p> so both pages now have opening and closing tags like they should.

Attached archive should be expanded to the paging module folder and requires that the .patch file from #5 be applied to the module.

q0rban’s picture

Status: Needs review » Needs work

This doesn't work with Views. Try creating a piece of content using a WYSIWYG input format. If that content is output using a View that has 'Trim this field to a maximum length' and 'Field can contain HTML' checked, it will display <!--paging_filter--> at the top of the output.

sun’s picture

Status: Needs work » Needs review

uhm, that's a bug in Views.

q0rban’s picture

Hmm.. I guess you are right, but my question is, why is it even adding that comment there? I have paging disabled for this content type, and therefore have no pagebreaks anywhere.

q0rban’s picture

Actually, it's probably due to this, as I would guess that views is using the core Drupal html corrector: #222926: HTML Corrector filter escapes HTML comments

drifter’s picture

Status: Needs review » Reviewed & tested by the community

Tested the plugin in #11 with the patch from #5 with Wysiwyg 2.1 and TinyMCE 3.3 - works fine. I think we're ready here...

aliciatheduff’s picture

This worked well for me!

johnphethean’s picture

I've unpacked the tar in the paging modules directory and added that patch code to the last line of paging.module. Then disabled and re-enabled both modules WYSIWYG and Paging but still can't see the button in FCK Editor, is there something i'm doing wrong?
Cheers

drifter’s picture

Here's how you apply a patch: http://drupal.org/node/60108

Did you enable the button in the Wysiwyg configuration after enabling the modules?

johnphethean’s picture

Sorry can't see the button to enable it. It does appear (along with everything else...) if I leave all the buttons unchecked but then I lose IMCE capability...
Even then actually the button doesn't break the page, FCK just adds the html: <div style="page-break-after: always;">

johnphethean’s picture

I must have applied the patch wrong as my verson beta3 of paging didn't have 913 lines as described in the patch? sorry not really a developer/coder...
Will maybe just wait for beta4 or whatever, will it be included?
Thanks for the help anyway...

kmonty’s picture

Is this ever going to move forward?

Gurpartap Singh’s picture

Coming weekend :)

john.kenney’s picture

#12, #15

@q0rban: thank you very much for this information. i've been struggling for several days here: http://drupal.org/node/728094. and your description in #12 was exactly my situation with views. i applied the patch shown in the thread at #15 and it resolved the problem perfectly.

jenlampton’s picture

Title: Implement hook_wysiwyg_plugin() » Implement hook_wysiwyg_include_directory()

Changing title :) Can we get this into the next paging release?

manuj_78’s picture

Bumping this up

hexblot’s picture

The latest patch (which works just fine for me, thanks!) has been "stable" for over 7 months now... is there a problem in actually including this in the next release?

jenlampton’s picture

patch in #5 still works for me :)

Anonymous’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta3

Patch #5 and #11 (using CKEditor) worked for me. Time to implement it in an updated version 6.x-1.1 or 6.x-1.0-beta4?

kardave’s picture

#11 works great with Paging 6.x-1.0-beta3 and Wysiwyg 6.x-2.3
Should be ported...

(The break and pagebreak buttons in TinyMCE are a bit similar, but that's fine)

lugir’s picture

Paging 6.x-1.0-beta3 and Wysiwyg module with CKEditor 3.4.2.6041

used patches of #11 and #5, Ckeditor can show a plugin button of “Add a page break to this content”, but when i click it, i got a js error "data.not is null", how could i fix it

thx for help :D

jenlampton’s picture

Status: Reviewed & tested by the community » Fixed

committed the patch from #5 and the paging_pagebreak plugin from #11.

jenlampton’s picture

Title: Implement hook_wysiwyg_include_directory() » Provide WYSIWUG API module support for Paging

more human-friendly title :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.