Archives

Archives / 2011 / June
  • Creating shapes on the fly

    (c) Bertrand Le Roy 2011Most Orchard shapes get created from part drivers, but they are a lot more versatile than that. They can actually be created from pretty much anywhere, including from templates. One example can be found in the Layout.cshtml file of the ThemeMachine theme:

    WorkContext.Layout.Footer
    .Add(New.BadgeOfHonor(), "5");

    What this is really doing is create a new shape called BadgeOfHonor and injecting it into the Footer global zone (that has not yet been defined, which in itself is quite awesome) with an ordering rank of "5".

    Read more...