Currently running a large D7 site  and currently looking at how i can move to either latest Drupal CMS or Backdrop. 

I've set up a backdrop cms install on my server and set up was really easy (awesome work on that and the clear documentation ! )

I'm now in the process of testing a number of features/ capabilities. 

Even though its a large site, I  don't plan to "upgrade" (its an option) - but I've used feeds quite extensively in the past and was expecting that i'll likely need to make some changes anyway (especially as some of the design/structure decisions made 10 years ago have plenty of room for improvement)

Backdrop seems the preferred route based on the investigation so far, but i do have 1 items that I need to figure out and that is paging.

currently in my D7 site, we used the smart_paging module (https://www.drupal.org/project/smart_paging) and this integrated into the CKeditor.

with backdrop the https://backdropcms.org/project/paging appears to be almost identical except for the CKeditor integration

for the main article content if use the raw HTML text formatter, the paging module works perfectly fine, and I get a nice paged output.

However if I switch to use the default "basic" (which is using Ckeditor 5) the editor removes the paging tags from the source ( looks to be some "clean up activity when switching between the 2 formatters).

Now ckeditor appears to come with a plugin ( maybe even in its core, I'm not 100% ) to support page breaks ( https://ckeditor.com/docs/ckeditor5/latest/features/page-break.html ), and i'm wondering if i can incorporate the pager button into the CKeditor, so that paging can work?
 

any ideas would be useful to help me figure this out? thanks

 

Accepted answer

Hi DeltaCanyon,

there's now a (brand new) TinyMCE plugin available: TinyMCE Paging

This won't fix the problem when switching to CKE5 - which behaves "opinionated" re markup - a known problem. But if you're only using TinyMCE, things should work just fine. No hacks or fancy adaptions necessary.

Comments

I know for a fact that TinyMCE doesn't strip them out but in my tests you are right about CKEditor stripping at source.  What you'll also need to do once the editor is not stripping out is add <!--> to the list of allowed tags. This is defined for each text format.

Once I did that with TinyMCE, then the <!--pagebreak--> code is passed through to the output.

You could use the TinyMCE Snippets module to make it easy to insert new ones.

I see you have already opened an issue in the paging module which is good:

https://github.com/backdrop-contrib/paging/issues/13

I don't know enough about CKEditor to know whether the module can fix this or if it needs to be added to the CKEditor part of the Backdrop CMS core product.

Yes good point on the allowed tags , however on trying it i hit a couple of issues...

If i added the tag <!--pagebreak--> or even <!-- --> it would still remove it when switching between text formats. 

I also tried adding <!--pagebreak--> in ckeditor after clicking view source, but again it disappeared 

I then tried just to see if i had an issue with entering the tag in the text format, and disabled the text format to limit HTML (so allowing any tag) but again still the same issue.

 

I didn't want to switch from the default editor , but having played with tinyMCE on another project a few years ago, that looks like a viable option and i'll at least take a look at it, thank you for the suggestion!

I found that it had to be specifically <!--> not <!--pagebreak-->

I tried both, when i tested but it still stripped it out :(

It won't fix CKEditor but would allow it in TinyMCE. However, the new module will probably add that anyway

indigoxela's picture

the new module will probably add that anyway

The module doesn't add anything to "Limit allowed HTML tags". If having the markup (or comment, it's configurable with Paging) in the node after saving is necessary, then <!--> should still be added to that filter setting - or whatever tag's configured on admin/config/content/paging.

But having it in the (displayed) node isn't actually necessary for the pagination functionality. The pager will still appear.

What I found from some quick testing ( having added tinyMCE) is that if i disable the restrict HTML tags option in the text format filter options, with TinyMCE the paging works, with CKEditor5 it does not.. 

however to be clear with tinyMCE paging I have the button in the WYSIWYG editor.

with CKeditor I'm not having to switch to source code view to add the page break tag and then switch back to show the WYSIWYG editor. I thin kits this step that is removing the pagebreak tag 

indigoxela's picture

Hi DeltaCanyon,

there's now a (brand new) TinyMCE plugin available: TinyMCE Paging

This won't fix the problem when switching to CKE5 - which behaves "opinionated" re markup - a known problem. But if you're only using TinyMCE, things should work just fine. No hacks or fancy adaptions necessary.

fantastic! thank you. 

I'll take a look at this later in the week , does seem like that would solve my issue for this type of content in the system