We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13137
    • 204 Posts
    Hello, I would like to do a few things with the default setup of .9.6, if anyone could help me out here.
    I believe them to be basic, but I’m an obvious noob.

    1. On the main page, I would like to display the most recent entry, in full from the blog.

    2. Possibly below that, an abbreviated list, kind of like what is in the side bar, that could display the short version of the latest posts.

    3. The most recent post from the blog would show the long view, followed by the short or normal view of the following posts.

    I hope this is clear enough to understand. Thanks for any help given.
      • 5727
      • 160 Posts
      Play around with the Ditto templates. Create a chunk with placeholders for a full post and assign it to &tplFirst, then create another chunk containing an abbreviated link and assign it to &tplRow. Use &sortBy and &sortDir to get the posts in the order that you need. Refer to ditto documentation for more info.
        Olivier Deland
        Montreal, Canada - Web Developer
        • 13137
        • 204 Posts
        I can not for the life of me figure this out. huh

        Can someone show me how to display a particular post from a blog on the front page, not necessarily the most recent post, just a particular one?

        Any help would be much appreciated.
          • 6726
          • 7,075 Posts
          ConseilWeb’s method will work if you want the latest post published on the home, but sticky is a bit different.
          There are several ways to do it but, let’s take one of the easiest :

          1) Create a template variable (type checkbox) called "promote_to_frontpage" (to do this go to Resources > Manage Resources > Template Variables, then "New Template Variable". In "Input Option Values" just add "sticky". Set the default value of "not sticky". Assign to your template. Now you can tick or not the sticky checkbox when editing a document.

          2) Place a Ditto Call on your front page :

          [tt][!Ditto? &parents=`id_of_your_news_folder` &display=`1` &filter=`promote_to_frontpage,sticky,2`.... other classic parameters... !][/tt]

          If you want several containers included, just type in a list of IDs [tt]&parents=`12,34,66`[/tt]
          [tt]&display=`1`[/tt] you can change this if you want to have several stickies smiley
          About &filter, check Ditto’s doc about filters for more details

          This should do the trick (unless I messed up the filter mode again tongue).
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id
            • 13137
            • 204 Posts
            Thank you for the help, I will give this a go and see how it works out for me.
              • 13137
              • 204 Posts
              OK, here is what I did. I placed the following code at the top of my page..

              [[Ditto? &startID=`2` &summarize=`1` &tpl=`nl_blog` &paginate=`1` &alwaysshow=`1`]]


              I dont know if this is the right thing to do, but it worked.

              Now I would like it to display a certain post from a blog, but cant seem to do it. I tried adding &displays`18` and with 18 being the doc id, and variations there of, but no go.

              Any other ideas?
                • 6726
                • 7,075 Posts
                Which version of Ditto are you using ?
                Since version 2.x &startID is replaced by &documents or &parents and &summarize is replaced by &display

                What you did was display the latest document on your home page, I thought you needed to display a sticky document (if so, please refer to the instructions above).

                If you need to display a selected blog post I think you can use &documents=`your_document_id` (anyone can confirm ? never used that feature)
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id
                  • 13137
                  • 204 Posts
                  Correct, I am attempting to display a sticky, but without much luck.

                  Maybe I’m not using the correct terminology, I would like to display a particular blog post on the front page regardless of other posts being added.

                  I am using the current 0.9.6 and tried "davidm" approach, but didn’t get it to work, so I don’t know if I just didn’t get it, or it isn’t working because of the version I/him are using.
                    • 5727
                    • 160 Posts
                    Maybe this sticky can help you:
                    http://ditto.modxcms.com/tutorials/25.html

                    Just put the Ditto called mentionned in the link above, right before your normal Ditto call.
                      Olivier Deland
                      Montreal, Canada - Web Developer