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

    I have been seeting up my companys intranet for some time now, using modx (switching from imcms). And nearly everything works as it should laugh
    BUT, now I have a news page with two columns, one shows small news and one shows bigger news. The documents lies in two different folders and the Ditto calls are different &startID=’4’ and &startID=’5’

    However, for pagination this doesn’t seem to differ, is it possible to tell the pagination Which folder it should look in?

    if you require more info, please tell me, and I should give that to you.
      • 18219
      • 826 Posts
      I found this in Doc:
      $startID = isset($startID) ? $ditto->cleanStartIDs($startID, $mode) : $modx->documentIdentifier;
      // the folder that contains post entries. separate by commas to use multiple folders
      
        Marc
        I'm French... Sorry for my bad English, I use ' Google Translator' or other... but that remains that tools wink
        • 17883
        • 1,039 Posts
        I think he means two (different) ditto calls. And I see the problem: The pagination of each paginated ditto is called with (for example):

        index.php?id=2&start=30


        so the "results" will both start at page 4 (in this example). What cybertron tries to achive a new parameter or something like that which only jumps to page 4 in the one ditto listing, not in the other. I guess you have to wait for Mark if he can put this into the snippet. Because now it´s not yet implemented (I think).
          • 18397
          • 3,250 Posts
          I don’t see how it is good for usability to have two calls with pagination on the same page. That is why I avoided coding this when I wrote the pagination component. Additionally, the URL’s would be messy as they would have to have a unique ID appended to every Ditto related parameter... If someone can make a compelling argument as to why this is beneficial, then I will add this to the codebase.
            • 6221
            • 36 Posts
            Hi!

            MadeMyDay has correctly understood my request, as for making a compelling argument for getting this into codebase, well, I need it laugh
            Well, actually it might be a good idea to implement it, many portalsites (which uses news) has a "small" newssection in the right/left and a mainnews in the middle...the main news might be for larger things with pictures and stuff, while the "small" newssection is for short news which might be updated more often.

            We, in my company, uses this because there are sometimes news that might not be important enough to stay on the frontpage forever, (and does not need images), so instead of having this in the main section where it stays for quite long it would go into the smallsection where it just exists.

            I am not sure how I could convince you, but maybe if you had the time, you could make an offical patch for it, and then they who want it, could use it. I am also quite sure (not entirely), that I came across this kind of discussion with NewsListing as well, I wonder....how did that discussion end?
              • 18397
              • 3,250 Posts
              I have managed to come up with one practical solution.

              What if, instead of having individual get parameters, have a single one called ditto_params which contains all of the parameters pertinent to a ditto call and would have a value similar to this:

              http://www.mysite.tld/page.html?ditto_params=dittocall1{param1,value||param2,value}dittocall2{param1,value2||param2,value2}
              


              This has some pro’s and cons.

              PRO:
              Allows for DittoMachine functionality through the URL string

              CON
              Creates a really uguly looking URL!

              From my experience, having a cleaner url is far more desireable than having multiple Ditto calls with pagination on the same page. If myself or someone else cannot come up with a more elegant solution, then this might go on the backburner as I don’t want to trash everyone’s URLs.
                • 6221
                • 36 Posts
                I have an idea for a somewhat cleaner soluition, if it is possible (i am no php coder sad )

                cant one just implement a $startID parameter (like in the ditto) and have the pagination "change the url" to reflect the id? (trick it, not really doing it)

                but This sounded better in my head than on "paper".
                ....
                  • 18397
                  • 3,250 Posts
                  What you are explaining is what my origional idea was, prefix (or append) a unique ID to each parameter so that Ditto knows which call it effects. Unfortunately, this would end up with parameters named &start_n=20 where n is a GUID (Global Unique Identifier).
                    • 6221
                    • 36 Posts
                    ah, ok.

                      • 33337
                      • 3,975 Posts
                      Why not you put a link which take a visitor to dedicated news page ? and paginate the news there ? e.g. 1 page for smaller news and other for bigger.

                      Just a suggestion.

                      regards.

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

                        Digging the interwebs for #MODX gems and bringing it to you. modx.link