Skip to content

Instantly share code, notes, and snippets.

@rcurlette
Created April 25, 2012 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcurlette/2490131 to your computer and use it in GitHub Desktop.
Save rcurlette/2490131 to your computer and use it in GitHub Desktop.
Tridion Razor Index PT
<!DOCTYPE html>
<html lang="en">
@importRazor("/webdav/20%20Developer%20-%20Templates%20-%20TomTom%2Ecom/Building%20Blocks/System/Razor%20TBBs/Html%20Header%20Snippet.cshtml")
<body>
<div class="container">
<!-- Main hero unit for a primary marketing message or call to action -->
<!-- ct_index_bannerText here MAX=1 -->
@{
foreach (var bannerCP in GetComponentPresentationsByTemplate("ct_index_bannerText")){
if(bannerCP.Index < 2) {
@bannerCP.RenderComponentPresentation();
}
}
<!-- END HERO-->
<!-- Example row of columns -->
<div class="row">
<!-- ct_index_intro here MAX=4. Index starts with 0 -->
@{
var intros = GetComponentPresentationsByTemplate("ct_index_intro");
foreach (var introCP in intros){
if(introCP.Index < 4){
@introCP.RenderComponentPresentation();
}
}
</div>
</div> <!-- /container -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment