cdeese8 Posted February 14, 2019 Share Posted February 14, 2019 Specifically, I desire having the "Support Knowledgebase Tag Cloud" sidebar panel title minimized on page load on knowledgebasearticle.tpl and knowledgebasecat.tpl pages. May you please recommend and share some wisdom? Might you know of a hook, that will automatically make it so the sidebar <div menuitemname="Support Knowledgebase Tag Cloud" class="panel panel-sidebar panel-sidebar"> is hidden / minimized by default? Thanks in advance for whatever help you can offer. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 15, 2019 Share Posted February 15, 2019 20 hours ago, cdeese8 said: Specifically, I desire having the "Support Knowledgebase Tag Cloud" sidebar panel title minimized on page load on knowledgebasearticle.tpl and knowledgebasecat.tpl pages. the following hook will minimise the tag cloud sidebar... <?php # Minimise Tag Cloud Sidebar Hook # Written by brian! function minimise_tag_cloud_sidebar_hook($vars) { $kbpages = ['knowledgebase','knowledgebasecat','knowledgebasearticle']; $templatefile = $vars['templatefile']; if (in_array($templatefile,$kbpages)) { return <<<HTML <script> jQuery(function(){ jQuery('div[menuItemName="Support Knowledgebase Tag Cloud"]').find('i[class~="fa-chevron-up"]').click(); }); </script> HTML; } } add_hook("ClientAreaFooterOutput", 1, "minimise_tag_cloud_sidebar_hook"); ?> if it doesn't work for you, then you may need to declare the array using the old-fashioned method... $kbpages = array('knowledgebase','knowledgebasecat','knowledgebasearticle'); ... or don't use in_array and just use an "or" to check for the $templatename values in the ID statement. 1 Quote Link to comment Share on other sites More sharing options...
cdeese8 Posted February 15, 2019 Author Share Posted February 15, 2019 Wicked. Thanks - it works! Much appreciated Brian, have a good day... 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.