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 totally lost with ditto - I have a news folder with some news items - let’s have a look at one news item :
    <div class="alignCenter">
    <img alt="" border="0" class="alignRight" height="90" name="image" src="assets/images/DSC03096_120x90.JPG" width="120" /> <img alt="" border="0" class="alignRight" height="90" name="image" src="assets/images/DSC02998_120x90.JPG" width="120" /> <img alt="Antelope Canyon in Page, AZ" border="0" class="alignRight" height="90" name="image" src="assets/images/DSC01140_120x90.JPG" width="120" /> <img alt="" border="0" class="alignRight" height="90" name="image" src="assets/images/DSC00851_120x90.JPG" width="120" /> 
    </div>


    as you can see, it’s just a little paragraph with a few images beneath.

    In the news summary, this is what I’m getting:

     <div class="ditto_summaryPost">
        <h2><span class="alignRight small">04. January 2006</span><a href="index.php?id=58">U.S. trip</a> </h2>
        <div class="clearfix">
          <p> We toured around the Southwest of the United States for six month in 2006 with the aim to compose an unlike illustrated book. </p>
          <div class="alignCenter"> <img alt="Yellowstone - Mammoth Hot Springs" border="0" class="alignRight" height="90" name="image" src="assets/images/DSC03096_120x90.</div></div>
      <p class="small"><a href="index.php?id=58">Read more...</a>
            </p>
          </div>


    the image src is just cut of resulting in a faulty src url - moreover, div tags are not closed properly (missing).

    Am I mis-using ditto? What am I doing wrong ?

    Hope somebody can help.

    this is the call:
    [!Ditto? &startID=`46` &summarize=`1` &total=`20` &paginate=`1` &alwaysshow=`1` &tpl=`DittoNewsTemplate` &dateFormat=`%d. %B %Y` !] 
    


    this is the chunk:
    <div class="ditto_summaryPost">
      <h2><span class="alignRight small">[+date+]</span><a href="[~[+id+]~]">[+title+]</a>
    </h2>
        <div class="clearfix">[+summary+]</div>
      <p class="small">[+link+]</p>
    </div>


    thank you in advance for your help.
      • 7923
      • 4,213 Posts
      You have to use the splitter tag option to define the place where your item content should be truncated or set it to be shown fully or increase the character limit on truncation.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 19889
        • 616 Posts
        thanks for replying - maybe I need to look for an alternative to ditto - I believe the snippet should just leave html tags alone and not split/cut them off - I have been using a newslisting snippet when using etomite and I didn’t have any problems in this regard - at least it left images etc. alone.

        how would I use the splitter with ditto if there are pictures in the text not knowing however whether there is a picture at all or anywhere in the text?
          • 18397
          • 3,250 Posts
          Truncation is enabled by default because 95% of users neglect to enter a summary. You can turn it off, per the documentation, with:

          &trunc=`0`
            • 19889
            • 616 Posts
            I’ll give that a try - you’re mentioning the "summary" - are you referring to the introtext?

            thank you
              • 18397
              • 3,250 Posts
              Yes

              Remember, if you want to just show all of the content in a custom template is faster to use [+content+] than summary.
                • 19889
                • 616 Posts
                thanks for the hint - actually, I wanted to show e.g. just the first paragraph or so but since the truncate function cuts off html tags, I guess I’m not able to use it that way since this would lead to unpredictable results.
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Quote from: mmjaeger at Jan 27, 2007, 01:31 AM

                  thanks for the hint - actually, I wanted to show e.g. just the first paragraph or so but since the truncate function cuts off html tags, I guess I’m not able to use it that way since this would lead to unpredictable results.
                  Probably the best way to do this would be to copy/paste the first paragraph into the summary/introtext field.
                    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
                    • 19889
                    • 616 Posts
                    Quote from: sottwell at Jan 27, 2007, 01:39 AM

                    Quote from: mmjaeger at Jan 27, 2007, 01:31 AM

                    thanks for the hint - actually, I wanted to show e.g. just the first paragraph or so but since the truncate function cuts off html tags, I guess I’m not able to use it that way since this would lead to unpredictable results.
                    Probably the best way to do this would be to copy/paste the first paragraph into the summary/introtext field.

                    I’m not sure of that - since one would normally use the wysiwyg editor the easiest way would be to go into the html view, copy the first paragraph or so and paste it to the introtext - while this is easy for somebody who understands a little html it would make things difficult for the "average" user - the best way, at least from my point of view, would be if ditto would either strip html tags in the first paragraph completely or neglect those - just cutting things off leads to undesireable results as mentioned earlier.

                    I’ll wind a way - thanks for your help
                      • 7923
                      • 4,213 Posts
                      Quote from: mmjaeger at Jan 26, 2007, 03:07 PM

                      I believe the snippet should just leave html tags alone and not split/cut them off - I have been using a newslisting snippet when using etomite and I didn’t have any problems in this regard - at least it left images etc. alone.
                      Not true, the eto newslisting snippets does just the same as ditto, it either truncates the text after certain character limit or uses some splitter tag to get the point where to split. Trust me.


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."