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/775809936db67661c344ba2d27770353 to your computer and use it in GitHub Desktop.
Save JonHolman/775809936db67661c344ba2d27770353 to your computer and use it in GitHub Desktop.
part-4-adding-category-landing-and-home-page: page.yaml handling invalid requests and setting a type variable to use later
#set($count = $items.size())
#if($count == 0)
#set($context.responseOverride.status = 404)
#set($_ = $items.add( {'heading':{'S':'Page not found'},'content': {'S':'<p><a href="/Prod/"><button>Go to the Home Page</button></a></p>'}} )) #elseif($count == 1 and $context.path.contains($items[0].sk.S))
#set($type = 'article')
#else
#set($type = 'category')
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment