We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24731 ☆ A M B ☆
    • 211 Posts
    Hello everyone, I am a bit confused about the order in which ditto imports the template variables and its been kind of tricky causing its display since I have been unable to identify or control the order of the output specifically for the template variables, not the actual entry. Here is my ditto call.

    [[Ditto? &format=`html` &parents=`2` &depth=`1` &display=`10` &tpl=`EntriesFilterDisplay` &hideFolders=`1` &sortDir=`DESC` &sortBy=`createdon` &showInMenuOnly=`1` &summarize=`10` &paginate=`1` &paginateAlwaysShowLinks=`1` &tagData=`LocCity,EatCuisine,EatPrice` &tagMode=`onlyTags` &tagDelimiter=`, `]]


    As you can see, I am making ditto import tag data from LocCity,EatCuisine,EatPrice. The problem is, that regardless the order in which i request them, ditto authoritatively controls the final output, making it a bit difficult for me to design how I want them displayed on each entry.

    Like sometimes, it may import the variables in the order:

    City,Cuisine,Price

    but on a different case it may come out as:

    Cuisine,City, Price

    and so on.

    It was very tricky achieving what I wanted initially and I had to implement some tricks, if my question is not clear enough I could detail everything I have done and exactly what the problem is to give a better overview.

    I appreciate any help.

    Regards,
    Jose R. Lopez
      • 18397
      • 3,250 Posts
      Ditto 2 does not preserve the order of tags, although it can sort them. If you feel this feature is important, please file a feature request for it the Ditto Bugtracker.
        • 24731 ☆ A M B ☆
        • 211 Posts
        Quote from: Mark at May 31, 2007, 05:51 PM

        Ditto 2 does not preserve the order of tags, although it can sort them. If you feel this feature is important, please file a feature request for it the Ditto Bugtracker.

        So they just come out randomly on every request?

        How can I effeciently customize the output then? I need to label some of those tags values but if I do and I have no control over the value displayed on each label, then i’ll end up with a very bad display sad.

        Any ideas?

        Jose
          • 24731 ☆ A M B ☆
          • 211 Posts
          Okay, thanks to your points, by a quick look at the documentation I discovered that tag tagSort by default tries to sort items alphanumerically. I simply switched this to off in my request and now the fields come in the same order as I request them in the call. This allows me to accurately position my elements in place since I now know what to expect.

          Thank you.

          Jose R. Lopez