cluster Posted September 11, 2017 Share Posted September 11, 2017 (edited) I use multiple languages and some links in the sidebar do not work, this links are using an rp= parameter inside. index.php?rp=/knowledgebase Announcements Knowledgebase Downloads How can I disable the sidebar for the above pages or edit the links to make them work w/ language parameter? Edited September 11, 2017 by cluster Link to comment Share on other sites More sharing options...
brian! Posted September 11, 2017 Share Posted September 11, 2017 i'd be tempted to do one of two things before modifying the sidebar... 1. switch to using Full Friendly URLs or Friendly Index.php in the Friendly URLs section of general settings. https://docs.whmcs.com/Friendly_URLs 2. report it as a bug... though index.php?rp=/knowledgebase&language=french does work for me using Basic URLs setting, so i'm unsure what's causing your issue without seeing your specific links. ultimately, you can change these links using action hooks, but i'd try the above options first before trying to modify the sidebars. Link to comment Share on other sites More sharing options...
cluster Posted September 11, 2017 Author Share Posted September 11, 2017 (edited) thanks! hmm strange ... the advaced tab > Environment Mode Inspection shows now a red cross for Full Friendly Rewrite (not supported) But I'm sure that mod_rewrite works ... .htaccess: RewriteEngine On #force lang de RewriteRule ^de/(.*).php?(.*)#(.*) /clients/$1.php?$2&language=german#$3 [NC,L,QSA] RewriteRule ^de/(.*).php?(.*) /clients/$1.php?$2&language=german [NC,L,QSA] RewriteRule ^de/(.*).php#(.*) /clients/$1.php?language=german#$2 [NC,L,QSA] RewriteRule ^de/(.*).php$ /clients/$1.php?language=german [NC,L,QSA] RewriteRule ^de/$ /clients/index.php?language=german [NC,L,QSA] RewriteRule ^de/(.*) /clients/$1 [NC,L,QSA] #force lang en RewriteRule ^en/(.*).php?(.*)#(.*) /clients/$1.php?$2&language=english#$3 [NC,L,QSA] RewriteRule ^en/(.*).php?(.*) /clients/$1.php?$2&language=english [NC,L,QSA] RewriteRule ^en/(.*).php#(.*) /clients/$1.php?language=english#$2 [NC,L,QSA] RewriteRule ^en/(.*).php$ /clients/$1.php?language=english [NC,L,QSA] RewriteRule ^en/$ /clients/index.php?language=english [NC,L,QSA] RewriteRule ^en/(.*) /clients/$1 [NC,L,QSA] #force lang fr RewriteRule ^fr/(.*).php?(.*)#(.*) /clients/$1.php?$2&language=french#$3 [NC,L,QSA] RewriteRule ^fr/(.*).php?(.*) /clients/$1.php?$2&language=french [NC,L,QSA] RewriteRule ^fr/(.*).php#(.*) /clients/$1.php?language=french#$2 [NC,L,QSA] RewriteRule ^fr/(.*).php$ /clients/$1.php?language=french [NC,L,QSA] RewriteRule ^fr/$ /clients/index.php?language=french [NC,L,QSA] RewriteRule ^fr/(.*) /clients/$1 [NC,L,QSA] #force lang fr RewriteRule ^lu/(.*).php?(.*)#(.*) /clients/$1.php?$2&language=luxembourg#$3 [NC,L,QSA] RewriteRule ^lu/(.*).php?(.*) /clients/$1.php?$2&language=luxembourg [NC,L,QSA] RewriteRule ^lu/(.*).php#(.*) /clients/$1.php?language=luxembourg#$2 [NC,L,QSA] RewriteRule ^lu/(.*).php$ /clients/$1.php?language=luxembourg [NC,L,QSA] RewriteRule ^lu/$ /clients/index.php?language=luxembourg [NC,L,QSA] RewriteRule ^lu/(.*) /clients/$1 [NC,L,QSA] # Announcements RewriteRule ^announcements/([0-9]+)/[a-z0-9_-]+\.html$ ./announcements.php?id=$1 [L,NC] RewriteRule ^announcements$ ./announcements.php [L,NC] # Downloads RewriteRule ^downloads/([0-9]+)/([^/]*)$ ./downloads.php?action=displaycat&catid=$1 [L,NC] RewriteRule ^downloads$ ./downloads.php [L,NC] # Knowledgebase RewriteRule ^knowledgebase/([0-9]+)/[a-z0-9_-]+\.html$ ./knowledgebase.php?action=displayarticle&id=$1 [L,NC] RewriteRule ^knowledgebase/([0-9]+)/([^/]*)$ ./knowledgebase.php?action=displaycat&catid=$1 [L,NC] RewriteRule ^knowledgebase$ ./knowledgebase.php [L,NC] # OpenID Discovery Document (http://openid.net/specs/openid-connect-discovery-1_0.html) RewriteRule ^.well-known/openid-configuration ./oauth/openid-configuration.php [L,NC] # security #RewriteCond %{QUERY_STRING} systpl=* #RewriteCond %{query_STRING} ^(carttpl=*)|(systpl=*)|(tpl=*)|(sld=*)|(tld=*)|(billingcycle=*)|(currency=*)(.*)$ #RewriteCond %{query_STRING} ^(carttpl=*)|(systpl=*)|(tpl=*)|(sld=*)|(billingcycle=*)|(currency=*)(.*)$ RewriteCond %{query_STRING} ^(carttpl=*)|(systpl=*)|(tpl=*)|(billingcycle=*)|(currency=*)$ RewriteRule ^(.*)$ https://www.mydomain.tld/? [R=301,L] - - - Updated - - - maybe .. would be better to disable/remove the sidebar if possible for: Announcements Knowledgebase Downloads Edited September 11, 2017 by cluster Link to comment Share on other sites More sharing options...
brian! Posted September 11, 2017 Share Posted September 11, 2017 thanks! hmm strange ... the advaced tab > Environment Mode Inspection shows now a red cross for Full Friendly Rewrite (not supported) But I'm sure that mod_rewrite works ... or did... but is not compatible with the Friendly URLS options included with v7.2+ maybe .. would be better to disable/remove the sidebar if possible for:Announcements Knowledgebase Downloads https://forum.whmcs.com/showthread.php?129834-Cannot-remove-some-items-on-a-sidebar-2e-hours-spent-Anyone-can-help-please&p=519162#post519162 <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Support'))) { $secondarySidebar->getChild('Support') ->removeChild('Announcements') ->removeChild('Knowledgebase') ->removeChild('Downloads'); } }); Link to comment Share on other sites More sharing options...
cluster Posted September 11, 2017 Author Share Posted September 11, 2017 wow, thank you! is this also possible w/ the left blocks for: - by Month (Announcements) - categories (Knowledgebase) - Tag Cloud (Knowledgebase) I do not find the variables for it ... Link to comment Share on other sites More sharing options...
cluster Posted September 11, 2017 Author Share Posted September 11, 2017 I was able to remove the tag cloud, but it does not work for the categories: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Support Knowledgebase Categories'))) { $secondarySidebar->removeChild('Support Knowledgebase Categories'); } }); Link to comment Share on other sites More sharing options...
brian! Posted September 11, 2017 Share Posted September 11, 2017 I was able to remove the tag cloud, but it does not work for the categories: they're both primary, not secondary, sidebars... so same hook code, but replace all references of secondary to primary... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Announcements Months'))) { $primarySidebar->removeChild('Announcements Months'); } if (!is_null($primarySidebar->getChild('Support Knowledgebase Categories'))) { $primarySidebar->removeChild('Support Knowledgebase Categories'); } }); Link to comment Share on other sites More sharing options...
cluster Posted September 11, 2017 Author Share Posted September 11, 2017 Great, Thank you Brian, that worked! Link to comment Share on other sites More sharing options...
dani88 Posted September 19, 2017 Share Posted September 19, 2017 I'm using WHMCS 7.2+ and would like to close the chevron of knowledge base tag sidebar as default instead of remove it. May you please a solution to do that? Thanks. Link to comment Share on other sites More sharing options...
brian! Posted September 19, 2017 Share Posted September 19, 2017 I'm using WHMCS 7.2+ and would like to close the chevron of knowledge base tag sidebar as default instead of remove it. May you please a solution to do that? good question - off-hand, I don't know the answer.... perhaps one for WHMC Andrew to reply to as this is undocumented.... and he's got access to code that I haven't! Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted September 22, 2017 WHMCS Developer Share Posted September 22, 2017 There isn't anything in the code that would load the bar closed. You could use a hook to insert some javascript to "click" the chevron on load. Untested, but something like this: jQuery('div[menuItemName="Support Knowledgebase Tag Cloud"]').find('i[class~="fa-chevron-up"]').click(); As for the hook, http://developers.whmcs.com/hooks-reference/output/#clientareaheadoutput 1 Link to comment Share on other sites More sharing options...
dani88 Posted September 23, 2017 Share Posted September 23, 2017 Thanks to Brian and Andrew. I've tested the following hook that of course didn't effect: <?php add_hook('ClientAreaHeadOutput', 1, function($vars) { $template = $vars['template']; return <<<HTML <link href="../../templates/six/css/custom.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> jQuery('div[menuItemName="Support Knowledgebase Tag Cloud"]').find('i[class~="fa-chevron-up"]').click(); </script> HTML; }); May you please check and correct my code? Also I have one question more, my Tags are so important, what will be happen if i use Brian's code to remove Support Knowledgebase Tag Cloud sidebar? Does it effect to my SEO articles they're include tags? Would be great with your kind answer. Link to comment Share on other sites More sharing options...
dani88 Posted September 23, 2017 Share Posted September 23, 2017 Thanks to Brian and Andrew. I've tested the following hook that of course didn't effect: <?php add_hook('ClientAreaHeadOutput', 1, function($vars) { $template = $vars['template']; return <<<HTML <link href="../../templates/six/css/custom.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> jQuery('div[menuItemName="Support Knowledgebase Tag Cloud"]').find('i[class~="fa-chevron-up"]').click(); </script> HTML; }); May you please check and correct my code? Also I have one question more, my Tags are so important, what will be happen if i use Brian's code to remove Support Knowledgebase Tag Cloud sidebar? Does it effect to my SEO articles they're include tags? Would be great with your kind answer. Link to comment Share on other sites More sharing options...
dani88 Posted October 10, 2017 Share Posted October 10, 2017 Is there anybody help me to solve this issue? Link to comment Share on other sites More sharing options...
jeffuk Posted December 13, 2017 Share Posted December 13, 2017 @dani88 if it helps, this worked for me... <?php add_hook('ClientAreaHeadOutput', 1, function($vars) { $template = $vars['template']; return <<<HTML <script> jQuery(function(){ jQuery('div[menuItemName="Categories"]').find('i[class~="fa-chevron-up"]').click(); }); </script> HTML; }); 1 Link to comment Share on other sites More sharing options...
brian! Posted December 13, 2017 Share Posted December 13, 2017 1 hour ago, jeffuk said: if it helps, this worked for me... it does indeed... though I doubt you need the template variable assigned in that way... if for no other reason than you're not using it! the only time it would be of use would be if you were minimising the sidebar on a specific template page, and even then you'd probably use templatefile instead. 1 Link to comment Share on other sites More sharing options...
Recommended Posts