We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36549
    • 572 Posts
    Hi,

    I would like to truncate the content of a page at a specific point and reading through the Ditto docs it suggests to me that the <!-- splitter --> can do this but i really don’t understand how this works. I’ve tried various ways and can only assume i am doing something wrong and not fully understanding this.
    Could anyone give an example please?

    Thanks

    J
      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 4971
      • 964 Posts
      Are you using Evo or Revo?
        Website: www.mercologia.com
        MODX Revo Tutorials:  www.modxperience.com

        MODX Professional Partner
        • 36549
        • 572 Posts
        Hi,

        I’m using evo 1.0.4.
        At the moment i’m using the &amp;truncLen=`400` &amp;truncOffset=`90` in order to truncate the posts but it sounds like i should be able to add a bit of code like <!-- splitter --> at an exact point in the page where i want it truncated, or am i mistaken?

        Cheers
          www.9thwave.co.uk
             WEB | DESIGN | PRINT
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          If you have the ’summary’ extender enabled (&extenders=`summary`):

          &truncAt
          Pur: Location to split the content at
          Opt: Any unique text or code string
          Default: ”<!-- splitter -->”
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 36549
            • 572 Posts
            Hi,
            Yes i have the summary extender enabled.
            Sorry but i’m still ot grasping this.
            Do i have to explicitly write in the ditto call "&truncAt=`splitter`"? or do have to write it differently i.e. <!--splitter-->?
            But then how do i reference this within the pages content at the truncate point?

            Thanks
              www.9thwave.co.uk
                 WEB | DESIGN | PRINT
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              If you don’t use the &truncAt= parameter, it will use <!-- splitter --> by default. Or you can use the &truncAt= parameter to make it split at whatever you want.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 36549
                • 572 Posts
                ok, i understand that but what do i physically have to add within the content where i want the text truncated?
                i tried <!--splitter--> but nothing happens.

                Thanks
                  www.9thwave.co.uk
                     WEB | DESIGN | PRINT
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I think there is a space between the -- and the word on both sides.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 36549
                    • 572 Posts
                    thanks, it finally works.
                    Now do you know if there is any way this can be added within the content rather than in the html?
                    I’ve tried it in a chunk but it doesn’t appear to work.

                    Thanks again
                      www.9thwave.co.uk
                         WEB | DESIGN | PRINT
                      • 7327
                      • 195 Posts
                      Yeah, putting it in the content area works for me. Just be sure it’s:

                      <!-- splitter -->

                      and not anything else like

                      <!--splitter--> or <!-- splitter-->