We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13825
    • 55 Posts
    How do i pull a single document onto the home page? I’m trying to use ditto and a startID of the document I want which has been set on the home page as a template variable.

    Are there any snippets that allow you to pass an id and a chunk name and then map the document to the chunk?

    Many thanks.

    Jdelight
      • 26799
      • 177 Posts
      This seems like a static solution. The kind of thing that would mean manually updating the [!snippet!] call every time you wanted it updated. If you wanted to publish all new documents to the homepage you could use something like this.

      [[Ditto?&startid=`0`&tpl=`rotatingHome`&summarize=`1`&sortBy=`pup_date`&sortDir=`ASC`&displayArchive=`0`&dateFormat=`%m,%d %y | %h:%m:%s`]]
      


      set up your tpl like this, really simple...

      rotatingHome {{CHUNK}}
      <h2><a href="[~[+id+]~]" tagret="_blank">[+longtitle+] <span>[+date+]</span></a></h2>
      [+content+]