We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12656
    • 13 Posts
    Currently I have a standard template acitve for my news: it shows all of the content. But I want to achieve the following: when there is a summary text, the summary text should show up in the ditto listing, along with a read on link. But when there is no summary link present, the normal content text should be visible.
    Cutting of the normal content text is not an option, since I have several articles that are too long and where it is nonsense to display just the first paragraph (or similar), since it is completely out of context. For that reason it would be perfect when I could use the summary for such long posts and that this summary would be displayed in the ditto listing, but without using a template that restricts the display to only this summary, since I have multiple posts with only content and no summary (because it does not make sense there).

    Andy ideas?
      • 18397
      • 3,250 Posts
      That is precisely what [+summary+], [+link+], and the summary extender in Ditto 2 were designed for. Just set &truncLen to some obscenely large number to prevent it from trimming your content.
        • 17717
        • 433 Posts
        Hi all, I was just going to post something similar, apologies if it should be a new thread.

        I am using Ditto and would like to do the same as what idiotic.marc is asking, that is, have certain articles display without a read more link. Not 100% sure how to use the summary extender to get the results I need. Here is what I currently have my my ditto call:

        [!Ditto? &startID=`8` &tpl=`ditto_articles` &tagData=`tvtags` &tagDelimiter=`,` &hideFolders=`1` &displayArchive=`0` &depth=`3` &summarize=`5`!]


        And there are certain articles in the folder that don’t need a read more link. Here is the chunk I am using to display the above:

        <div class="line"></div>
        <div class="ditto_summary">
        	<div class="ditto_head">
        <div class="ditto_headLeft">
            <h3 class="noheight"><a href="[~[+id+]~]">[+title+]</a></h3>
            <div class="commentCount">
        <div class="ditto_headRight">
        Posted on [+date+] by [+author+]  [[tagLinks? &id=`[+id+]` &tv=`tags` &separator=`, ` &fap=`1` &path=`notebook` &label=`Tags: ` &style=`dittoTags`]]
        </div>
        </div>
        </div>
        </div>
        
           <div class="ditto_content">
        		<p>[+introtext+]  [+link+]</p>
        <p><a href="[~[+id+]~]">Read more...</a></p>
        	</div>
        
        </div>


        Also, and probably more complicated, is that I would like to display commenting for a select number of articles, I currently don’t have it in the above chunk because as far as I know, I cannot pick and choose which articles to display commenting on when I make a ditto call to a container.

        Sorry for the lame questions, would be great if either or both of the above can be done.

        Thanks
        Lee
          http://www.blend.uk.com | Web Design by Blend
          • 18397
          • 3,250 Posts
          Here are the steps you need to take.

          1. Add &extenders=`summary` and &truncLen=`9999999` (if you don’t want it to truncate your main content when it is displayed) to the Ditto call.
          2. Replace [+introtext+] with [+summary+]
          3. [+link+] will now show whenever any document has the introtext field filled or the content is truncated. Otherwise it will be blank.

          You could do the commenting via a TV checkbox with values 0 (off) or 1 (on) and then use a PHx conditional inside the tpl to say if the value is 1 then show a Jot otherwise output nothing.
            • 17717
            • 433 Posts
            Thanks Mark, your a legend, just wish I knew how to create the PHx conditional. Can anyone help me with this?

            Thanks
            Lee
              http://www.blend.uk.com | Web Design by Blend
              • 18397
              • 3,250 Posts
                • 12656
                • 13 Posts
                Mark, I love you.

                But one small problem remains: I can’t format the summary text, that means I can’t apply the formating paragraph, so the <p>-Tags are missing.
                  • 18397
                  • 3,250 Posts
                  Why can’t you format the summary text?
                    • 12656
                    • 13 Posts
                    I meant formating it with tinymce (apply paragraph formating styles, so that the html output has p-tags). adding p-tags in the template chunk would not work, since I would have two p-tags when normal content is displayed (instead of summary text).
                      • 18397
                      • 3,250 Posts
                      You can enable the RTE for the summary field using a plugin. Raymond (xwisdom) wrote one some time ago.