mikecheung Posted October 28, 2013 Share Posted October 28, 2013 (edited) I need some help figuring out if there is a way to determine if a hook has content assigned to it on a specific page and based on this information do something within a template file. Example : Scenario : On my category page, my left column hook has a menu module to be displayed, but on my product page my left column hook does not have any module assigned to be displayed. Goal : In header.tpl, I would like to add a class to my main content wrapper if left column hook does not have any content to be displayed. I hope this make sense and appreciate any help the community can provide. Thanks. Edited October 28, 2013 by mikecheung (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 28, 2013 Share Posted October 28, 2013 you can use simple if condition: {if !empty($HOOK_LEFT_COLUMN)} DISPLAY COLUMN {else} HIDE COLUMN {/if} 1 Link to comment Share on other sites More sharing options...
mikecheung Posted October 28, 2013 Author Share Posted October 28, 2013 Thank you very much. I did try that before but forgot to check if any other modules are assigned to that hook but not displaying anything (which was the case). Your answer at least showed me that the problem was else where. Thanks. 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