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

    I’ve become a bit confused regarding the "right" way to create a summary using Ditto. I was using the Summary field in the document editor and calling that content using the [+introtext+] placeholder. That really wasn’t the most efficient, so I started trying to learn how to pull the first portion of the [+content+] field as a summary on an article "teaser" page. I’ve replaced the [+introtext+] placeholder with [+summary+] and added the &extenders=`summary` parameter to my Ditto call. That seems to work, but the summary either truncates at the first period ("."), or after what appears to be a fixed number of characters.

    I then tried to learn how to dictate the truncation point by learning about the "default_splitter", but I couldn’t figure out what that was. Based on some older NewsListing documentation, I tried <!--Splitter-->, but the summary still truncated at the first period. I then scanned the Ditto snippet code and couldn’t find a "default_splitter" parameter.

    Then reading through Bill Fernandez’s Ditto documentation, he states that the summary extender "Adds support for the legacy [+summary+] placeholder." If [+summary+] has been deprecated, what is the current "best practice" for incorporating a portion of the content as a "summary"??

    Help?!

    Chris
      • 33337
      • 3,975 Posts
      Please read: http://ditto.modxcms.com/extenders/summary.html

      I hope you will find it helpful. You will need to use the other params in the Summary extenders to make it work as per your need, and its easy.

      regards.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 5210
        • 43 Posts
        I see. So the Ditto summary feature was replaced by the introtext field in the document manager. Hmm. I guess I was following the current protocol already. Is there a way to "autofill" the introtext field? I suppose that might be similarly as resource intensive as the summary process is (was)...

        Chris
          • 5210
          • 43 Posts
          Although after thinking about it, I can understand why this might have been changed. The author might want to specifically control what the summary says, rather than have it "slave" to the main content...

          Chris
            • 5210
            • 43 Posts
            Is there a change in the works that will incorporate the WYSIWYG editor into the Summary field? That might help for non code-savvy editors.

            Chris
              • 7231
              • 4,205 Posts
              The summary ditto extender will summarize the content field. By default it will take the first 300 chars but you can change that via the &truncLen parameter. I don’t think the introtext field was a replacement for the summary function. They have different purposes. I like to use the introtext field since the auto truncating can be messy (and if you use markup can be a headache). I always use the :notags PHx extender with the summary placeholder to avoid any markup making it through (I think that is why the introtext field does not sport a RTE).

              When using the summary extender you need to use the [+summary+] placeholder to get the truncated version. If you use the [+content+] placeholder you will get the full content.

              If you need a summary field with an RTE the easiest method is to use a TV for that and then use ManagerManager to hide the unused field. Maybe ManagerManager has the ability to add a RTE to the introtext, if not it may be a nice plugin.
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 5210
                • 43 Posts
                Seems like the Summary function is still utilized quite a bit. A quote from the Ditto Summary Extender documentation:

                "The "Summary" extender provides legacy support for the Ditto v1.x era [+summary+] placeholder and it’s associated parameters...As for version 2, Ditto will no-longer support the summary placeholder natively as it is resource intensive and superseded (introtext field)"

                That’s why I said that it appeared as if the Summary feature was replaced by the "Introtext" field.

                No matter. I’ll either use it or I won’t...

                Thanks!

                Chris