2010-10-05 08:28:06 -07:00
|
|
|
@{
|
2010-10-06 14:02:37 -07:00
|
|
|
Style.Include("site.css");
|
|
|
|
|
2010-10-05 08:28:06 -07:00
|
|
|
// cool stuff goes up here
|
|
|
|
var homeUrl = Href("~/");
|
2010-09-30 13:03:48 -07:00
|
|
|
|
2010-10-05 08:28:06 -07:00
|
|
|
// Zone is an alias for Display
|
|
|
|
Func<dynamic, dynamic> Zone = x => Display(x);
|
2010-10-06 14:02:37 -07:00
|
|
|
|
|
|
|
if (Model.Sidebar != null) {
|
2010-10-11 12:48:15 -07:00
|
|
|
Model.Classes.Add("has-sidebar");
|
2010-10-06 14:02:37 -07:00
|
|
|
}
|
2010-10-11 12:48:15 -07:00
|
|
|
|
|
|
|
//Model.Attributes.Add("onclick", "javscript:alert('woot')");
|
|
|
|
|
|
|
|
Model.Id = "layout-wrapper";
|
|
|
|
var tag = Tag (Model, "div");
|
|
|
|
|
2010-10-05 08:28:06 -07:00
|
|
|
}
|
2010-10-11 10:32:54 -07:00
|
|
|
|
2010-10-11 12:48:15 -07:00
|
|
|
@* Add a wrapping div around everything *@
|
|
|
|
@tag.StartElement
|
|
|
|
|
|
|
|
@* needs to be the page title, not page (head) title... *@
|
|
|
|
@* Adds text and html to the header zone *@
|
|
|
|
|
|
|
|
@using(Capture(branding => WorkContext.Layout.Header.Add(branding) )) {
|
|
|
|
<h1 id="branding"><a href="@homeUrl">@WorkContext.CurrentSite.SiteName</a></h1>
|
|
|
|
}
|
2010-10-11 10:32:54 -07:00
|
|
|
|
2010-10-05 08:28:06 -07:00
|
|
|
<header id="layout-header">
|
|
|
|
@if(Model.Header != null) {
|
|
|
|
<div id="header">
|
|
|
|
@Zone(Model.Header)
|
2010-09-30 13:03:48 -07:00
|
|
|
</div>
|
2010-10-05 08:28:06 -07:00
|
|
|
}
|
2010-10-11 10:32:54 -07:00
|
|
|
</header>
|
|
|
|
|
|
|
|
|
2010-10-05 08:28:06 -07:00
|
|
|
@if(Model.Navigation != null) {
|
2010-10-11 10:32:54 -07:00
|
|
|
<div id="navigation" class="group">
|
2010-10-05 08:28:06 -07:00
|
|
|
@Zone(Model.Navigation)
|
2010-09-30 13:03:48 -07:00
|
|
|
</div>
|
2010-10-05 08:28:06 -07:00
|
|
|
}
|
2010-10-11 10:32:54 -07:00
|
|
|
|
|
|
|
|
2010-10-11 12:48:15 -07:00
|
|
|
<div id="layout-content" class="group">
|
2010-10-05 08:28:06 -07:00
|
|
|
@if(Model.Messages != null) {
|
|
|
|
<div id="messages">
|
|
|
|
@Zone(Model.Messages)
|
|
|
|
</div>
|
|
|
|
}
|
2010-10-08 17:10:41 -07:00
|
|
|
|
|
|
|
@* This code would inject text into the Featured zone.
|
|
|
|
@{WorkContext.Layout.Featured.Add("just some text in featured");}
|
|
|
|
*@
|
|
|
|
|
|
|
|
@{
|
|
|
|
WorkContext.Layout.Featured.Add(New.Featured(insertMessage:"This is a featured blog post."));
|
|
|
|
}
|
|
|
|
@if(Model.Featured != null) {
|
|
|
|
<div class="zone-featured group">
|
2010-10-05 08:28:06 -07:00
|
|
|
@Zone(Model.Featured)
|
|
|
|
</div>
|
|
|
|
}
|
2010-10-08 17:10:41 -07:00
|
|
|
|
|
|
|
@{
|
|
|
|
WorkContext.Layout.Recent.Add(New.Recent());
|
|
|
|
}
|
|
|
|
@if(Model.Featured != null) {
|
|
|
|
<div class="group">
|
|
|
|
@Zone(Model.Recent)
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
|
2010-10-11 12:48:15 -07:00
|
|
|
@{WorkContext.Layout.Sidebar1.Add("just some text in featured");}
|
|
|
|
@if(Model.Sidebar1 != null) {
|
|
|
|
<aside class="sidebar">
|
|
|
|
@Zone(Model.Sidebar1)
|
|
|
|
</aside>
|
|
|
|
}
|
|
|
|
|
2010-10-07 10:53:02 -07:00
|
|
|
@* the model content for the page is in the Content zone @ the default position (nothing, zero, zilch) *@
|
2010-10-05 08:28:06 -07:00
|
|
|
@if(Model.Content != null) {
|
2010-10-08 17:10:41 -07:00
|
|
|
<div id="content" class="group">
|
2010-10-05 08:28:06 -07:00
|
|
|
@Zone(Model.Content)
|
2010-09-30 13:03:48 -07:00
|
|
|
</div>
|
2010-10-05 08:28:06 -07:00
|
|
|
}
|
2010-10-08 17:10:41 -07:00
|
|
|
else {
|
|
|
|
<div id="content" class="group">
|
|
|
|
Let's take over the home page
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
|
2010-10-05 08:28:06 -07:00
|
|
|
@if(Model.Sidebar != null) {
|
2010-10-07 11:46:07 -07:00
|
|
|
<aside class="sidebar">
|
2010-10-05 08:28:06 -07:00
|
|
|
@Zone(Model.Sidebar)
|
|
|
|
</aside>
|
|
|
|
}
|
2010-10-07 11:46:07 -07:00
|
|
|
|
2010-10-11 12:48:15 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
@{
|
|
|
|
WorkContext.Layout.Footer.Add(@Display.User());
|
|
|
|
}
|
2010-10-08 17:10:41 -07:00
|
|
|
@if(Model.Footer != null) {
|
2010-10-11 12:48:15 -07:00
|
|
|
<footer id="layout-footer" class="group">
|
2010-10-08 17:10:41 -07:00
|
|
|
@Zone(Model.Footer)
|
|
|
|
</footer>
|
|
|
|
}
|
|
|
|
else {
|
2010-10-11 12:48:15 -07:00
|
|
|
<footer id="layout-footer">
|
2010-10-08 17:10:41 -07:00
|
|
|
Powered by Orchard @Display.User()
|
2010-10-05 08:28:06 -07:00
|
|
|
</footer>
|
2010-10-08 17:10:41 -07:00
|
|
|
}
|
|
|
|
|
2010-10-11 12:48:15 -07:00
|
|
|
@tag.EndElement
|