We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20648
    • 26 Posts
    How do I get the summary text of one specific document from my three, on the front website?

    I need a call to get the specific ID and not the startID, I think...

    This is what I have so far.

    [!Ditto? &startID=`67` &total=`1` &descendentDepth=`0`&displayArchive=`0`&trunc=`1` &truncLen=`200` &truncText=`read more...`!]


    This only gives me a listing of the last document. The one I want is the summary of document ID 67...

    How can I do this?
      • 26799
      • 177 Posts
      This’ll work:
      [!Ditto?&startID=`0`&tpl=`CHUNKNAME`&filter=`id,67`&summarize=`1`&displayArchive=`0`&trunkText=`more...`&descendentDepth=`99`!]
      


      create a new chunk with the following Code, As long as it’s name matches the &tpl=`CHUNKNAME` in your ditto snippet call you’re good to go.

      {{CHUNK}}
      <div class="homeSummery">
       <h2><a href="[~[+id+]~]">[+longtitle+]</a></h2>
          <p> [+summary+]</p>
      </div>
      


      It seems kinda odd to want a single id on the page, you might as well add the content to the home page it’s self.

      I would suggest a convention. Set up a container and rotate content on the home page based on the most recently published document in that directory.

      [!Ditto?&startID=`contanerID`&tpl=`CHUNKNAME`&sortBy=`pub_date`&sortDir=`DESC`&summarize=`1`&displayArchive=`0`&trunkText=`more...'!]
      


      This will output the summery for the most recent page added under your "containerID"(numeric). Giving your homepage the much sought after Google appeal...

      hope this helped.
        • 13825
        • 55 Posts
        This worked for me - but I have template variables assigned to the id of the document I’m calling - does a Ditto call have access to tv’s?
        Or do I have to use something else to get these values through e.g. use the GetField snippet?

        Thanks
          • 13825
          • 55 Posts
          SOLVED - you need to add "tv" as a prefix to the template variable name - e.g [+tvTemplateVariableName+] grin
            • 20648
            • 26 Posts
            Thanks, that worked.
            I never thought of using the filter parameter in ditto.

            The reason I want a specific ID is that I want a dynamically generated summary text i.e. a small company presentation/teaser. Instead of writing it on the front side, I want to have that information gathered one place. With a lot of content, it is handier to edit the information directly on the relevant page instead of doing this several places on the site. Less work and more logical...
              • 26799
              • 177 Posts
              cool. sounds interesting.
                • 13825
                • 55 Posts
                How would you do this with Ditto 1.1b2?

                I’ve just upgraded and the call that worked here now doesn’t - basically it looks like I can pass a filter e.g &filter=`id,2` where document id 2 is a child of the site root.

                But any document thats within document 2 doesn’t get seen by the ditto call?

                How do I solve this? here’s the ditto call:

                [[Ditto?  &startID=`0` &tpl=`spotlight-item`  &multiLevel=`1` &filter=`id,7`  &summarize=`1`  &descendentDepth=`99` ]]


                Appreciate you help, thanks.
                  • 13825
                  • 55 Posts
                  once again replying to myself - descendantDepth renamed to just depth for Ditto 1.1. laugh