Created
April 25, 2012 14:27
-
-
Save rcurlette/2490074 to your computer and use it in GitHub Desktop.
Tridion Razor Detail Page Template TBB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@functions{ | |
public string GetSidebarCssClass(Models.ComponentPresentationModel sidebarCP){ | |
var cssClass = ""; | |
if(sidebarCP.IsFirst){ | |
cssClass = "first"; | |
} | |
return cssClass; | |
} | |
} | |
<!DOCTYPE html> | |
<html> | |
<!-- head tag in razor tbb --> | |
@importRazor("/webdav/20%20Developer%20-%20Templates%20-%20TomTom%2Ecom/Building%20Blocks/System/Razor%20TBBs/Html%20Header%20Snippet.cshtml") | |
<body> | |
<div class='container'> | |
<div class='row'> | |
<div class='span9' id='content'> | |
<!-- Article --> | |
@foreach (var articleCP in GetComponentPresentationsByTemplate("rct_Detail")){ | |
@articleCP.RenderComponentPresentation() | |
} | |
</div> | |
<div class='sidebar span3'> | |
<div class='block'> | |
<div class='row'> | |
<!-- sidebar here... --> | |
@foreach (var sidebarCP in GetComponentPresentationsByTemplate("rct_Sidebar")){ | |
<div class='block @(GetSidebarCssClass(sidebarCP))'> | |
@sidebarCP.RenderComponentPresentation() | |
</div> | |
} | |
</div> | |
<br> | |
</div> | |
</div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment