This project is read-only.

To create a zone in layout.cshtml page

Topics: General
Sep 19, 2011 at 5:26 PM


I want to create a zone in layout.cshtml page..i given a code like this in my theme layout.cshtml page

var asideClassthird = CalcuClassify(new [] {"Asidethirdleft", "Asidethirdright"}, "aside-"); // for aside-1, aside-2 or aside-12 if any of the aside zones are filled
    if (HasText(asideClassthird)) {



<aside id="aside-thirdleft" class="aside-thirdleft">
         @if (Model.Asidethirdright != null) {
    <aside id="aside-thirdright" class="aside-thirdright">


  • This i had given in my site.css

#aside-thirdleft {}
    #aside-thirdright {}

.zone-asidethirdleft {}
.zone-asidethirdright {}


.aside-1 #layout-content { float: right; width: 620px; }
.aside-1 .aside-thirdleft { float: left; width: 340px; }

/* If zone 2 is on */
.aside-2 #layout-content { float: left; width: 620px; }
.aside-2 .aside-thirdright { float: right; width: 340px; }

/* If zones 1, 2 are on */
.aside-12 #layout-content { width: 620px; }
.aside-12 .aside-thirdleft, .aside-12 .aside-thirdright { width: 170px; }
.aside-12 .aside-thirdleft, .aside-12 .aside-thirdright, .aside-12 #layout-content { float:left; }


but my layout is not coming tin the admin dashboard. please anyone suggest me how to say what is the mistake in this code.




Sep 19, 2011 at 8:32 PM

Hi Selva,

The widgets page in the dashboard doesn't read the available zones from your layout.cshtml file. It gets them from the Theme.txt manifest file(s) from your currently active theme(s). The zones in the manifest are just a comma separated list of zone names. If you add your "Asidethirdleft" and "Asidethirdright" zone names to the Theme.txt file in your theme, you should see them in the list of zones displayed in the dashboard.

Sep 20, 2011 at 6:25 AM


Thank you a lot. its great..its working.