To create a zone in layout.cshtml page

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

 Hi,,

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)) {
        Model.Classes.Add(asideClassthird);
    }

 

 

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

 

  • 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.

 

Thanks

selva

Sep 19, 2011 at 7: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 5:25 AM

kevink,

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

Thanks

selva