Skip to content

Instantly share code, notes, and snippets.

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 JonHolman/7301edf0b4fe1db2511570aa40f0ab69 to your computer and use it in GitHub Desktop.
Save JonHolman/7301edf0b4fe1db2511570aa40f0ab69 to your computer and use it in GitHub Desktop.
part-4-adding-category-landing-and-home-page: page.yaml new main content section
<div class="w3-col l8 s12">
#if($type =='article')
<!-- Blog entry -->
<div class="w3-card-4 w3-margin w3-white">
<div class="w3-container">
<h3>
#set($buildingPath = '')
#foreach($pathPiece in $items[0].sk.S.split('/'))
#if(!$foreach.first and !$foreach.last)
#set($buildingPath = "${buildingPath}/${pathPiece}")
<a href="/Prod$buildingPath">$pathPiece > </a>
#end
#end
<b>$items[0].heading.S</b>
</h3>
#if(!$items[0].description.isEmpty())
<h5>$items[0].description.S, <span class="w3-opacity">$items[0].date.S</span></h5>
#end
</div>
<div class="w3-container">
$items[0].content.S
</div>
</div>
</div>
#else
#foreach( $item in $items )
<div class="w3-card-4 w3-margin w3-white">
<div class="w3-container">
<h3>
#set($buildingPath = '')
#foreach($pathPiece in $item.sk.S.split('/'))
#if(!$foreach.first and !$foreach.last)
#set($buildingPath = "${buildingPath}/${pathPiece}")
<a href="/Prod$buildingPath">$pathPiece > </a>
#end
#end
<a href="/Prod$item.sk.S"><b>$item.heading.S</b></a>
</h3>
#if(!$item.description.isEmpty())
<h5>$item.description.S<br/><span class="w3-opacity">$item.date.S</span></h5>
#end
</div>
<div class="w3-container">
$item.content.S.split("</p>")[0]</p>
#if(!$item.sk.isEmpty())
<p>...</p>
<div class="w3-row">
<div class="w3-col m8 s12">
<p>
<a href="/Prod$item.sk.S">
<button class="w3-button w3-padding-large w3-white w3-border"><b>READ MORE</b></button>
</a>
</p>
</div>
<div class="w3-col m4 w3-hide-small">
<p><span class="w3-padding-large w3-right"><b>Comments</b> <span data-sk="$util.urlEncode($item.sk.S)" class="w3-tag numComments">0</span></span></p>
</div>
</div>
#end
</div>
</div>
#if( $foreach.hasNext )
<hr>
#end
#end
<!-- END BLOG ENTRIES -->
</div>
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment