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

    First off I’d just like to say how much I’m enjoying using Modx, I’ve developed a number of site using it now and have found it to be very flexible and easy to modify.

    One problem I am having however is using ditto to show news updates on the front page, I’ve got no issues with the snippet - it works, but I can’t get the truncation function to work. I’ve searched the site a number of times but can’t see if theres a TV I need to implement or if it should work straight out of the box.

    Heres my snippet call.

    [[Ditto? &startID=`6` &summarize=`2` &removeChunk=`Comments,documentInfo` &tpl=`News` &extenders=`summary` &trunc=`1` &truncLen=`200`]]

    Can anyone offer me any advice?

    Thanks!
      • 10289
      • 14 Posts
      It would be really cool if I could get this thing working, truncation is the one issue I constantly have with Ditto and it seems like it should be one of the simplest things to implement.

      Is there a TV I need to instance?

      Does anyone know of any useful tutorials I could go have a look at?

      Help me sort it and I’ll write one!
        • 18397
        • 3,250 Posts
        Can you provide the contents of the News chunk please?
          • 10289
          • 14 Posts
          News chunk looks like this

          <div class="ditto_summaryPost">
          <h2>[+title+]</h2>
          <div class="ditto_info" >[+date+].</div>
          [+introtext+]
          <a href="[~[+id+]~]" title="[+title+]"> [+link+]</a>
          </div>

          I’ve recently updated to the SVN version of ditto, which has got the debug console to work and it looks like modX is recognising the parameters I’ve enabled, but not acting upon them. Would love to get this working, its one of the only barriers to my gaining mastery of modx!

          Thanking you in advance.
            • 36592
            • 970 Posts
            I think that [+summary+] holds truncated text of content field.
            So try changing [+introtext+] to [+summary+].
              • 10289
              • 14 Posts
              I’ve tried both [+summary+] and [+introtext+] and they produce the same results. However you having said that makes me think I may be using the module in the wrong way.

              I’ll do some testing and report back when I know.

              Thanks again for the help. Very much appreciated! grin
                • 10289
                • 14 Posts
                Right, after minor testing Im happy to say it was my fault! When entering the news item i was treating the summary field a - well - summary of the blog content, if I leave it blank Modx display the truncated version of the main blog content.

                What a dick I am! I’ve built about 10 sites in Modx and never realised!

                Thanks for all the help guys, hope I didnt waste too much of your time.

                Top marks again on the CMS.