page break

Permalink 1 user found helpful
the tinyMCE pagebreak function does not work
<p><!-- pagebreak --></p>
I have looked in the forums but found no answer please help

markrodtech
View Replies:
MattWaters replied on at Permalink Reply
MattWaters
Hi markrodtech,

This is an option that can be set in Dashboard > System & Settings > Basics > Rich Text Editor. Or just type "Editor" into Intelligent Search and that should give you a link to the page.

Then select the "Custom" editor option to define the various options and buttons that you want to use.

Pagebreak has to be enabled somewhere in your list of TinyMCE plugins:

plugins: "inlinepopups,spellchecker,safari,advlink,table,xhtmlxtras,emotions,paste,visualchars,nonbreaking,style,searchreplace,fullscreen,advimage,pagebreak",


And then actually called somewhere in your list of buttons:

theme_concrete_buttons3 : "image,|,anchor,link,unlink,|,charmap,|,abbr,|,styleprops,removeformat,code,|,fullscreen,|,pagebreak",


The pagebreak button lets you insert an HTML element that you've defined in your TinyMCE init, so you might then have a line like this (notice that I've escaped the double quotes in the tag with a leading backslash-- this is important!):

pagebreak_separator : "<span style=\"page-break-before: always;\"></span>",


So I took a good example of a custom Editor config from this thread:
http://www.concrete5.org/community/forums/usage/more_user_friendly_...

And added the pagebreak example as I demonstrated above. Here's the complete code I pasted into my Custom editor field:

theme : "concrete", 
plugins: "inlinepopups,spellchecker,safari,advlink,table,xhtmlxtras,emotions,paste,visualchars,nonbreaking,style,searchreplace,fullscreen,advimage,pagebreak",
editor_selector : "advancedEditor",
spellchecker_languages : "+English=en",   
theme_concrete_buttons1 : "styleselect,formatselect,fontsizeselect,tablecontrols",
theme_concrete_buttons2 : "bold,italic,underline,|,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,blockquote,|,replace,|,pastetext,pasteword,|,undo,redo,|",
theme_concrete_buttons3 : "image,|,anchor,link,unlink,|,charmap,|,abbr,|,styleprops,removeformat,code,|,fullscreen,|,pagebreak",
theme_concrete_blockformats : "p,address,pre,h1,h2,h3,div,blockquote,cite",
theme_concrete_toolbar_align : "left",
theme_concrete_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
theme_concrete_font_sizes : "1,2,3,4,5,6,7",
theme_concrete_styles: "Note=ccm-note",
spellchecker_languages : "+English=en",
pagebreak_separator : "<span style=\"page-break-before: always;\"></span>"


This produces a pagebreak button, and when clicked it inserts that span into the text you're editing with TinyMCE.

Now I noticed when I did this in my local test environment I got a 404 on trans.gif, some kind of placeholder image that TinyMCE is trying to use during preview. However if you take a look at the source of the HTML created, you'll see that TinyMCE is inserting the code exactly as we wanted. That 404 is something we should look into, but I think that should be enough for you to get your custom pagebreak options working.
markrodtech replied on at Permalink Reply
markrodtech
Thanks for the input but this didn't work any other suggestions
MattWaters replied on at Permalink Reply
MattWaters
Page break in TinyMCE simply inserts an HTML element into your content, as explained above. That's all it does. It's up to you to define that element in a way that works for your needs.
bizstarz replied on at Permalink Reply
bizstarz
Matt, thanks. That was an incredible amount of detail. But even if it works, that is a surprising amount of custom work for a feature that is so useful and common on websites, including possibly, concrete.org. Is pagination a function that could be packaged and offered in c5's marketplace?
kirkroberts replied on at Permalink Reply
kirkroberts
Sorry to revive an old thread, but I'm getting the same 404 on the trans.gif image (after inserting a page break) and wonder if there is a solution to fix that?
MattWaters replied on at Permalink Reply
MattWaters
Seems like it may just be a bug in tinymce? I see the same issue mentioned elsewhere on the web in the context of other CMSes. Looks like the easiest workaround I've found so far is to just do a 301 redirect on the requested path to index.php:

Redirect 301 /concrete/js/tiny_mce/themes/concrete/img/trans.gif http://your-concrete5-site.com/index.php


This issue is a bit of an edge case, and considering both that and the fact that TinyMCE-in-the-content-block is going away in the next big version of concrete5 (5.7) sometime in the next few months, this might be the best approach.

That said, the 404 only turns up while you're editing the block-- so assuming that it does not interfere with your editing experience (works fine here), you shouldn't need to worry too much about it. It's not a 404 that a site visitor would see.

Hope that helps! Here's the wordpress-related thread I found if you're curious:
http://stackoverflow.com/questions/14318552/need-to-redirect-404-to...