Meaning ?

Topics: General
Sep 21, 2011 at 10:35 AM

Hi , i saw in the layout.chtml these :

/* Inserting some ad hoc shapes
    ***************************************************************/

    WorkContext.Layout.Header.Add(New.Branding(), "5"); // Site name and link to the home page
    WorkContext.Layout.Footer.Add(New.BadgeOfHonor(), "5"); // Powered by Orchard
    WorkContext.Layout.Header.Add(New.User(), "10"); // Login and dashboard links

 

I want to understand the functionning process in general behind these code ? also what's means "5","10" ?

thks

Sep 21, 2011 at 11:32 AM

Those commands define where ( Header / Footer ) and what ( Branding, BadgeOfHonor , SignIn Stuff ) is added. 5 / 10 is the position in that zone for the order of the Items ( i.e. adding something with position "6" in Header would place it between the Branding and the SignIn Stuff.

Sep 21, 2011 at 11:41 AM

ok ! thks a lot

Sep 21, 2011 at 2:57 PM

This is creating some new shapes on the fly, called "Branding", "BadgeOfHonor" and "User", and adding them to the Header and Footer zones on the Layout shape. Bertrand Leroy has a good blog post about this here: http://weblogs.asp.net/bleroy/archive/2011/06/30/creating-shapes-on-the-fly.aspx. I also cover some of this in my Orchard Fundamentals course on Pluralsight here: http://www.pluralsight-training.net/microsoft/courses/TableOfContents?courseName=orchard-fundamentals

Sep 21, 2011 at 3:38 PM

thks you

May 27, 2013 at 3:25 PM
So great ! Thanks a lot :)