Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Saxby 1444 posts 1855 karma points
    Mar 17, 2017 @ 15:53
    Gordon Saxby
    0

    Order properties from multiple Compositions

    I am using Compositions to create a "pick and mix" set of properties that can be used to create a "Settings" tab. I would like to be able to fix the order in which the properties ultimately appear but I can't see a way of doing that.

    So, I (currently) have 4 composition DocTypes each with one property. Each one has the same named tab of "Settings" but I have given each one a different sort order (100, 110, 120, 130).

    When I use "Compositions" to add them onto an other DocType, there does not appear to be any way of enforcing a specific order of the combined Composition properties on the resulting "Settings" tab.

    Am I missing something or is this just not catered for?

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Mar 17, 2017 @ 22:55
    Marc Goodson
    100

    Hi Gordon

    There is an open Issue here regarding this:

    http://issues.umbraco.org/issue/U4-6738

    Each property has a sort order value stored against it in the underlying database table, and this is used to provide the sorting. (The sort order of the tab is unintuitively irrelevant)

    However it is set within the context of the composition...

    so Composition1-Property1 will have a sortorder of 0 and Composition2-Property1 will have a sortorder of 0 Composition1-Property2 will have sortorder of 1

    hence they are all jumbled up.

    As you can see, this is where we currently are with properties combined on the same tab from different compositions for sort order.

    Your options are to use SQL:

    Update cmsPropertyType Set sortOrder = 5 where Alias = 'propertyAlias'
    

    To artificially increase the sort order outside of the ux, to fudge the order across the compositions

    or

    If you don't like executing SQL, add fake label properties to push down the real properties on a composition, then delete the fake label properties - the real ones will keep their increased 'sort order' number!

    or

    use uSync, the definition of the properties are stored in the uSync files including their SortOrder, so you can update the files on disc with the artificially sort order - then use uSync to import the changes back into the Umbraco db.

    regards

    Marc

  • Gordon Saxby 1444 posts 1855 karma points
    Mar 20, 2017 @ 08:42
    Gordon Saxby
    0

    add fake label properties to push down the real properties on a composition, then delete the fake label properties - the real ones will keep their increased 'sort order' number

    Thanks Marc, that worked!

Please Sign in or register to post replies

Write your reply to:

Draft