yaniv14 Posted February 8, 2015 Share Posted February 8, 2015 Hi, Is there a way to check if custom hook is empty in a template. like: {if isset(hook h="pageBackground")} I have a custom hook that I want to show default content if the hook doesn't have content for a specific page. Link to comment Share on other sites More sharing options...
zod Posted November 24, 2016 Share Posted November 24, 2016 (edited) It is weird how this question was not solved yet, all forum is about how to make new custom hooks, but nothing about how to output in a better way.I've searched a lot, and here it is some informations.The simple way, as it is in the documentation: {hook h='myCustomHook'} Alterantive way: {hook::exec('myCustomHook')} And finally, a version to check if the hook displayFooterTop is set (i wanted to add some extra tags in a template): {assign var='displayFooterTop' value={hook h='displayFooterTop'} } {if $displayFooterTop} <div class="footer-top"> {$displayFooterTop} </div> {/if} Edited November 24, 2016 by zod (see edit history) 2 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now