Orchard CMS Quick Tip–Zoned out, or Why changing Placement.info still doesn’t move your module

This is a common problem that can catch out Orchard users and developers but after you learn this easy to remember tip you should be able to solve it quickly whenever you experience in the future.

You might be trying to move the default placement.info in your module, or overriding it in a theme. No matter what you try the module stays firmly in its original place. You’ve checked and double checked the zone name, the casing, the weights and

Frustrating right? Well let me turn that frustration from annoyance with Orchard into kicking yourself:

You missed the forward slash off the front of the zone.

Yep it was just one character that was stopping your module from moving to its desired location.

You see, Orchard has two types of zones, the local zone and the global zone.

By default the zone your <place> tag refers to is a "local zone" which means that it only sees the zones in that modules shape file (the .cshtml). This is useful to move it around in the immediate template to places such as header, content, footer, meta, etc.

However, if your zone is a "global zone", as in one that is defined in the theme.txt and is used somewhere in your global layout.cshtml file, then you need a forward slash at the start. This is how you move it around the template to zones like AsideFirst, AfterMain and FooterQuadThird.


Add a slash at the start eg from:

<Place Parts_Accreditations="AfterMain:0"/>


<Place Parts_Accreditations="/AfterMain:0"/>

No comments :