We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52024
    • 15 Posts
    I have resources with the following TVs:

    Artist: Input Type Resource List
    Width: Input Type Text
    Height: Input Type Text
    Year: Input Type Text
    Description: Input Type Rich Text

    Art Image: URL

    I am unable to charge the sort order for the Art Image. No matter what number I set its Sort Order to, the Manager wants to place it at the bottom. How do I change this?

    Thanks.


    This question has been answered by BobRay. See the first response.

      • 3749
      • 24,544 Posts
      Setting it to 0 should put it at the top, but only if the other TVs on the list are set to higher values. If they're all 0, they'll usually be in the order they appear in the DB, iow, the order in which they were first created.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 52024
        • 15 Posts
        Quote from: BobRay at Jul 18, 2017, 03:07 AM
        Setting it to 0 should put it at the top, but only if the other TVs on the list are set to higher values. If they're all 0, they'll usually be in the order they appear in the DB, iow, the order in which they were first created.

        I tried that, and have tried many other combinations. For instance, setting the Sort Order to

        Artist: 100
        Width: 200
        Height: 300
        Year: 400
        Description: 500

        Art Image, URL: 0

        Still places the Art image at the bottom of the Resource.
        • discuss.answer
          • 3749
          • 24,544 Posts
          Hmm... I found this in the TV controller under the resource controller:

          $c->sortby('cat_category,TemplateVarTemplate.rank,modTemplateVar.rank','ASC');


          Apparently, the rank of the TemplateVarTemplate object takes precedence over the TV's rank (and the TV's category takes precedence over both).

          So ... try editing the Template they belong to and setting the rank on the "Template Variables" tab. You only need to do this for TVs in a particular category (since that's the first sort criteria). I guess the reasoning for this is that you might want to have them in a different order for resources with different templates.

          Let me know if it works. wink
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 52024
            • 15 Posts
            Quote from: BobRay at Jul 18, 2017, 09:34 PM
            Hmm... I found this in the TV controller under the resource controller:

            $c->sortby('cat_category,TemplateVarTemplate.rank,modTemplateVar.rank','ASC');


            Apparently, the rank of the TemplateVarTemplate object takes precedence over the TV's rank (and the TV's category takes precedence over both).

            So ... try editing the Template they belong to and setting the rank on the "Template Variables" tab. You only need to do this for TVs in a particular category (since that's the first sort criteria). I guess the reasoning for this is that you might want to have them in a different order for resources with different templates.

            Let me know if it works. wink

            Yes it worked and I do want them to be in a different order depending on the template. Many thanks.
              • 52024
              • 15 Posts
              Quote from: BobRay at Jul 18, 2017, 09:34 PM
              Hmm... I found this in the TV controller under the resource controller:

              $c->sortby('cat_category,TemplateVarTemplate.rank,modTemplateVar.rank','ASC');


              Apparently, the rank of the TemplateVarTemplate object takes precedence over the TV's rank (and the TV's category takes precedence over both).

              So ... try editing the Template they belong to and setting the rank on the "Template Variables" tab. You only need to do this for TVs in a particular category (since that's the first sort criteria). I guess the reasoning for this is that you might want to have them in a different order for resources with different templates.

              Let me know if it works. wink

              Yes it worked and I do want them to be in a different order depending on the template. Many thanks.
                • 3749
                • 24,544 Posts
                I'm glad you got it sorted. Thanks for reporting back. smiley
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting