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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By stevelack
      I am trying to remove the sidebar menu "Actions" from the My Products and Services page.  I have created the following hook:
      ```
      <?php
      use WHMCS\View\Menu\Item as MenuItem;
      add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
      {
         if (!is_null($primarySidebar->getChild('My Services Actions'))) {
                  $primarySidebar->removeChild('My Services Actions');
         }    
      });
      ```
      But it is not removing the sidebar from the page /clientarea.php?action=services
      What am I doing wrong?
      Thanks,
      Steve
    • By Web Host Pro
      Any idea what hook I can add to remove these side bar ads? I'm still selling these products? I just don't want them on the side bar right now. I might add them back later.
      I checked my current hooks and non seem to line up with these sidebar ads. I assume I need to add a new hook to remove these.
      Thanks for any help.

    • 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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

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