What is the recommended way to hide the side menu?

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Adam
User
Posts: 480

What is the recommended way to hide the side menu?

Post by Adam »

I need to hide the side menu for anonymous users because the top navbar is used to provide casual visitor menu options.

Previously, I was using the following code in the Page_Loading event:

global $BODY_CLASS;

if (!IsLoggedIn())
	$BODY_CLASS .= ' sidebar-collapse';
else
	$BODY_CLASS .= ' sidebar-mini';

However, as reported elsewhere, this now leaves white-space where the vertical menu would be, rather than expanding the content and footer regions into that empty space.

Could anyone explain how best to achieve the old behaviour?


mobhar
User
Posts: 11745

Post by mobhar »

White sidebar menu issue has actually been fixed in the latest build version of 2020.0.6. Please make sure you have already re-downloaded again the latest version once more, and then uninstall the older 2020.0.6 version, and install again that latest version.

For more info, please visit this topic: http://hkvforums.com/viewtopic.php?f=4&t=45871


Adam
User
Posts: 480

Post by Adam »

I updated to the latest 2020.0.6 and cleared all browser data, then did a full regeneration of the scripts.

Unfortunately, it's made no difference at all...

  • with my body class code commented out, the left nav bar + logo area above it are grey: the logo area displays correctly, as does the "empty" left menu area (because there are no active left menu items)

  • with my body class code enabled, the left nav bar and logo area are both white and empty ...but these areas previously appeared hidden - as if the push-menu button had been clicked.

I know that I can trigger the menu push with jQuery after the page has loaded, but I want to avoid the flicker / animation that occurs with that approach.

Any thoughts?


Adam
User
Posts: 480

Post by Adam »

Okay... found the solution :)

global $BODY_CLASS;
if (!IsLoggedIn() || isset($_GET['hide']))
	$BODY_CLASS .= ' layout-top-nav';  <== needs this rather than the old "sidebar-collapse" class
else
	$BODY_CLASS .= ' sidebar-mini';


Post Reply