We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16645
    • 5 Posts
    Hi,

    I’m actually working on a webzine layout :

    http://www.coycoy.com/snap.jpg

    As a newbie to Modx I would like to know the right way to manage the display of the 2 main blocks in the page

    - on top of the page, the "main" block containing the last article (image + article beginning)
    - at the bottom of the page, the "previous article list" block

    What’s the best method to do this job ?

    Thanks in advance for all the answers that we help me to go further in this project smiley

    LB
      • 727
      • 502 Posts
      You can use Ditto to manage adding new articles and then automatically show the latest one at the top and the two most recent at the bottom. However the top article has the image seperated out, but with Ditto I believe that it needs each article as a single HTML block. If you can move the image next to the text, like you have it for the other articles below, then I think that would make things easier. Otherwise you might have to process the output from Ditto using a custom snippet to seperate out the image from the text for the first article only. Should be fairly easy to do. You can use a placeholder for the image.

      Andy

        • 33337
        • 3,975 Posts
        You can use multiple Ditto calls, for example:

        [!Ditto? &tpl=`top-template` &startID=`xxx` &summarize=`1`!] , where {{top-template}} chunk will match the said layout for top post.

        For the bottom posts layout, develop another html chunk e.g. {{bottom-template}} and call it:

        [!Ditto? &tpl=`bottom-template` &startID=`xxx` &summarize=`2` &start=`2`!]

        For more information on snippet parameters, please read: http://modxcms.com/ditto_documentation.html and http://modxcms.com/ditto_parameters.html

        I hope this helps.

        regards,

        zi
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 16645
          • 5 Posts
          Thanks a lot for the answers, that helps a lot, the project is going smoothly but surely laugh

          LB
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Now I remember hacking the old NewsListing snippet to have the first item display the whole article, and the subsequent ones just the truncated summary. As I recall, it wasn’t all that difficult. Hmm. I haven’t really looked at the Ditto code yet.
              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
              • 7923
              • 4,213 Posts
              and in the second ditto call, use &start=`2` parameter to skip the first item that is shown by the first ditto call..


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 33337
                • 3,975 Posts
                Nice catch doze! laugh

                Thanks for the correction.

                (I’ve edited my above post also)

                regards.

                zi
                  Zaigham R - MODX Professional | Skype | Email | Twitter

                  Digging the interwebs for #MODX gems and bringing it to you. modx.link
                  • 11975
                  • 2,542 Posts
                  Hi,

                  In my opinion, you don’t need to call twice ditto.
                  You have to setup the &tplFirstRow parameter to display the first doc with diiferent layout.

                  :-)
                    Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                    • 7923
                    • 4,213 Posts
                    Yes heliotrope, that suits the best for this case! I wasn’t aware of that parameter yet, thanks!


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 16645
                      • 5 Posts
                      Thanks again for all the answers.

                      Now, I’ve got another question regarding the images... how can I automate the image upload / resizing / displaying process?

                      In the image url I’ve posted just above you can see that for a special article category (here "dans mon assiette") I got the
                      last article on top with an associated image and at the bottom the older articles with their respective image.

                      On a journalist side, how can we proceed when someone wants to post a new article and associate image(s) to it ?
                      How do I handle the image resizing process ? and then... How do I handle the right image display in the article category ?

                      Thanks a lot for your answers.

                      LB