We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19889
    • 616 Posts
    Hello
    I’m sure this has been asked an hundred times already in this forum but I couldn’t find a solution yet.

    I’d like to have a little news listing on my page with just a little summary of the content with a more... link at the end.

    what’s the proper way to do this when using ditto 2.1?

    played for hours and couldn’t get it to work yet.

    thank you in advance for your help.
      • 7231
      • 4,205 Posts
      you need to load the summary extender.
      http://ditto.modxcms.com/files/assets/snippets/ditto/extenders/summary-extender-inc-php.html

      If you are using [+summary+] or [+link+] in your templates append &extenders=summary to your Ditto call
        [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't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 19889
        • 616 Posts
        Is this the way to do it in ditto 2.1 or is there a better way - I was finally able to get it working the way you say but only by using the splitter comment - I’d prefer to do it dynamically or if that’s not possible I need to look for a way to add something to tinymce that would allow me to add the splitter comment through the editor.
          • 7231
          • 4,205 Posts
          AFAIK this is the way to do this. Did you try with the summarize parameter &summarize=`5` rather than the &display parameter? Not if this would still be needed.
            [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't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 19889
            • 616 Posts
            only works with the splitter so far

            this is the call:
            [[Ditto?id=`dittoCall`&startID=`17`&paginate=`1`&summarize=`5`&truncText=`Weiter...`&extenders=`summary,dateFilter`&paginateAlwaysShowLinks=`1` &tpl=`tpl-EventListing`]]


            and this is the chunk:
            <div class="post">
              <div class="postheader">
                <h2>[+title+]</h2>
                <div class="postmeta">[+longtitle+]</div>
                <!-- postmeta end -->
              </div>
              <!-- postheader end -->
              <div class="entry">[+summary+] <p class="more small">[+link+]</p>
            </div>
            </div>


            while &truncText seems to work adding e.g. &truncLen doesn’t do anything at all?!

            Thank again for your patience.


            Figured it out - my fault - sorry for bugging you. The reason was the following:

            I’ve a chunk called "Lorem" with just two dummy paragraphs - obviously the whole ditto truncate stuff happens before the lorem chunk got included in the page.

            sorry for that