We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8120
    • 10 Posts
    hi there. i am currently trying to place a news-block right into my template
    i tryied several diffrent things....
    e.g. snippet call within the template
    <div id="news">[[Ditto? &amp;parent=`18` &amp;tpl=`DittoTemplate` &amp;extenders=`request` &summarize=`5` paginate=`1`]]</div>

    ->no documents found

    well...i also tryied to do a work around via TV....but with the same result...
    so if anyone might help me..?

    thanks
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Instead of "&parent" try &startID

      Here’s one I’m using:
      [!Ditto? &startID=`8,9,10` &displayArchive=`0` &tpl=`HomeNews` &dateFormat=`%d %b %Y` &trunc=`1` &truncLen=`150` &truncChars=`1` &summarize=`3` &truncText=`...more` &mode=`production`!]
      

      And the HomeNews chunk:
      <div class="ditto_summaryPost">
      <h5>[+date+] - [+title+] [+link+]</h5>
      </div>

      And the snippet call and its chunk template for a similar box with images (images set with a TV with "image" input and "image" widget output):
      [!Ditto? &startID=`58` &displayArchive=`0` &tpl=`NewProds` &dateFormat=`%d %b %Y` &trunc=`1` &truncLen=`150` &truncChars=`1` &summarize=`3` &truncText=`...more`!]
      

      <div class="ditto_summaryPost">
      <p class="newProds">[+tvProdThumb+] [+date+] - [+longtitle+][+link+]</p>
      </div>
        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
        • 8120
        • 10 Posts
        well thanks for the fast reply....
        seems to work, but the output is only plain-text....[+link+] doesnt work...
        <h5>21 Mar 2007 - Dritte News </h5>

        any suggestions ?
        i placed the snippet call directly in my template

        //thanks


        edit:
        hier is my former chunk which works
        <h3><a href="[~[+id+]~]">[+title+]</a></h3>
        <p>
        [+introtext+]

        <em>by <strong>[+author+]</strong> [+date+]</em>
        </p>

        also i dont know how to do the "totalpages - next - previous" etc....
        seems not to work..
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Ok, the sample I gave are from an old version of Ditto. You may need to dig into the Ditto documentation to see what is needed for the current version.
            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
            • 8120
            • 10 Posts
            well...i just started to work with modx...
            i am not a developer...and the documentation is so far confusing....

            anyway....it works...and now letz see if i can modifiy and study the functionality of ditto2.0.1

            thanks...
            if you have any more suggestions for calling snippets etc...just drop a line
              • 8120
              • 10 Posts
              well...it takes a while...but at least the news section is setup.
              but....
              [!Ditto? &startID=`18` &displayArchive=`0` &tpl=`news` &dateFormat=`%d %b %Y` &summarize=`3` &trunc=`1` &truncLen=`150` &truncChars=`1` &truncText=`...mehr` &alwaysshow=`1` &paginate=`1`!]

              ->when i am using [+summary+] instead of [+introtext+] nothing will be shown, on the other hand i am not able to "trunc" the introtext, so the editor has to do it himselve....

              ?help
                • 25663 MODX Staff
                • 12,272 Posts
                If you want to use the summarization features, you would add &extenders=`summary` or something like that.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 8120
                  • 10 Posts
                    • 8120
                    • 10 Posts
                    one question:
                    sure i can place a picuter within the content or even as a TV....
                    but..how do i tell modx that this "thumb" shall be handled as a thumb ? e.g. 25x25px and then on the detail page in big ?

                    ? thanks for more advice !

                    edit:
                    and even tho...if i place a thumb as TV how the hell do i get this one to be displayed within the content ? or do i have to have 2 images one big-sized placed in the content and one small-sized placed in the teaser ?

                    isnt that too inconvinient ?
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Yeah, it is inconvenient. Anybody that feels up to it could create a snippet using phpThumb or some similar thumbnail creating library, and use that in the Ditto call.
                        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