Last active
December 16, 2020 14:29
-
-
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
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
#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