Jump to content
cdeese8

How do I default minimize sidebar panel title on page load?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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. thanks.png

  • Like 1

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By web2008
      In Standard Cart/sidebar-categories-collapsed.tpl the link to Register a New Doman  "cart.php?a=add&domain=register" hardcoded.
      Does anyone know how to change this link to e.g domainchecker.php?
    • By web2008
      I need to add some Bootstrap Tooltip to the Sidebar under Manage Domain.
      Anyone who knows how this can be done?
    • By wp4all
      Hi @ all,
      I'm searching for a solution to hide on click the Sidebar.
      Has anyone ever had experience with it?
      I have already made single menu hide over a hook.
      Now I do not want to remove it completely but just let it slide out.
      The rest should of course be extended by this part.

      Could be also a commercial version.
      Thank you and best regards
      Christian
    • By web2008
      I have a menu/hook I want to display only for one or more product groups.Is there anyone who can help me with this?
      function sitebuilder_hook_sidebar($sidebar) {     $actions = $sidebar->getChild('Service Details Actions');     if ($actions) {         $actions->addChild('Sitebuilder', array(             'name' => 'Sitebuilder',             'label' => 'Sitebuilder',             'uri' => 'index.php?m=sitebuilder',             'order' => 999,             'attributes' => array(                 'target' => '_blank'  
    • By Reza
      Hello guys,
      I'm customizing the six template for my non-latin language and also making the urls seo friendly. but since the WHMCS built-in seo friendly feature only supports a-z characters I've decided to modify some htaccess and template codes to achieve my goal.
      I was almost successful except for knowledgebase sidebar urls that are still shows up in WHMCS way (a-z chars).  
      Any ideas how to modify sidebar urls as well?
      I want the knowledgebase sidebar urls to be like this :
      {$WEB_ROOT}/help/{$kbcat.id}
  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated