We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37099
    • 338 Posts
    Using <!-- splitter --> requires your user to be comfortable going into the HTML and putting it there rather than just relying on the rich text editor (which will convert the characters to HTML entities because it thinks it is content not a comment). This is straight forward to a coder but not for potential users who don’t necessarily know anything about writing code.

    To allow a user to add the splitter in their rich text editor do this:

    In your Ditto call you could make &truncAt=`+END_SUMMARY+`

    Create a plugin that triggers on ’OnWebPagePrerender’ in System Event tab

    Add this code to the plugin:

    $dittoContainer = 149; // the number of the document containing your ditto call
    $parent = $modx->documentObject[’parent’];

    if($parent == $dittoContainer){
    $output = $modx->documentOutput;
    $output = str_replace("+END_SUMMARY+","",$output);
    $modx->documentOutput = $output;
    }


    Hope that helps
    Mike
      • 36549
      • 572 Posts
      Thank you very very much Mike...that works exactly as expected and i’ll be using it on quite a few sites.
      This should have been added to Ditto as default as it’s such a handy function.
        www.9thwave.co.uk
           WEB | DESIGN | PRINT
        • 11460
        • 10 Posts

        Split/truncate your content easy with TinyMCE´s pagebreak-Button

        Great work Mike!

        In addition to this you can use in TinyMCE the button "template" or better "pagebreak"! Make a test and click the button for pagebreak, to see in html-mode what tinymce say´s in the source: "<!-- pagebreak -->".

        So you only need to change in the following line of the (Mike´s) plugin:

        Quote from: thingstodo at Mar 03, 2011, 06:52 AM


        $output = str_replace("+END_SUMMARY+","",$output);

        the "+END_SUMMARY+" to "<!-- pagebreak -->".

        greetings
        Guenter