What is the proper way of assigning value to order attribute

Vote:
 

What is the proper way of assigning value to order attribute of pages and blocks? In startpage of Alloy template, properties are assigned with random order values like 300, 350, 400 whereas buttonblocks is assigned with 1,2 etc. It looks like the order number of one content does not conflict with that of another content.

UPDATED:

    public class StartPage : SitePageData
    {
        [Display(
            GroupName = SystemTabNames.Content,
            Order = 320)]
        [CultureSpecific]
        public virtual ContentArea MainContentArea { get; set; }

        [Display(GroupName = Global.GroupNames.SiteSettings, Order = 300)]
        public virtual LinkItemCollection ProductPageLinks { get; set; }

        [Display(GroupName = Global.GroupNames.SiteSettings, Order = 350)]
        public virtual LinkItemCollection CompanyInformationPageLinks { get; set; }

        [Display(GroupName = Global.GroupNames.SiteSettings, Order = 400)]
        public virtual LinkItemCollection NewsPageLinks { get; set; }

        [Display(GroupName = Global.GroupNames.SiteSettings, Order = 450)]
        public virtual LinkItemCollection CustomerZonePageLinks { get; set; }
    }
#200592
Edited, Jan 18, 2019 4:33
Vote:
 

Are you referring to page, tab ordering or the ordering of pages/blocks in a folder in the content tree?

#200598
Jan 17, 2019 10:39
Vote:
 

@Scott Reed : I have updated the question.

#200632
Jan 18, 2019 4:35
Vote:
 

Hi Bill,

We only need to make sure that the order of property is identity in same tab and same content. There is a best practice about setting order value is not setting order value consecutively if you want to insert new properties in future.

For example:

  • If you have a content with property A - order 1, property B - order 2 => So what happen if you want to insert a property A' between A and B, first of all you must change order of B
  • Else if property A - order 100, property B - order 200 then you do not need to change order of B, you can insert more new 99 properties between A and B with order from 101 - 199

Hope this help

#200633
Jan 18, 2019 7:28
Vote:
 

As  Binh said it's just down to tab and numerical value. So as long as per tab the values increment they will appear in the correct order.

At my agency we increment in values of 10 so that if we need to place a property in between two others you can, else if it's just single number increments you'd have to renumber

#200637
Jan 18, 2019 9:36
Vote:
 

My practice to have groups increment in 100's but then have increments of just 1 within group properties

        [Display(
           Name = "Product Page Links", 
           GroupName = Global.GroupNames.SiteSettings, 
           Order = 100)]
        public virtual LinkItemCollection ProductPageLinks { get; set; }

        [Display(
           Name = "Company Information Links",
           GroupName = Global.GroupNames.SiteSettings, 
           Order = 101)]
        public virtual LinkItemCollection CompanyInformationPageLinks { get; set; }

        [Display(
           Name = "News Page Links"
           GroupName = Global.GroupNames.SiteSettings, Order = 102)]
        public virtual LinkItemCollection NewsPageLinks { get; set; }

        [Display(
            Name = "Basket page",
            GroupName = Constants.TabNames.CommerceSiteSettings,
            Order = 200)]
        public virtual ContentReference BasketPage { get; set; }

        [Display(
            Name = "Checkout page",
            GroupName = Constants.TabNames.CommerceSiteSettings,
            Order = 201)]
        public virtual ContentReference CheckoutPage { get; set; }

#200638
Edited, Jan 18, 2019 10:13
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.