Hide Side bar on login page only

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

Hide Side bar on login page only

Post by andyrav »

Hi
I want to only hide the left side menu on the login page.
I have added

$('[data-widget="pushmenu"]').PushMenu('collapse');

to login page> startup script

which works, but how to i reset it back to default after login?

thanks


andyrav
User
Posts: 664

Post by andyrav »

tied adding

$("body").addClass("sidebar-collapse")

to login page> startupscript
this didnt work

any idea?
i only want the sidebar closed on login

thanks


arbei
User
Posts: 9787

Post by arbei »

You better add the 'sidebar-collapse' CSS class to body tag instead.

You may search "sidebar-collapse" in this forum.


andyrav
User
Posts: 664

Post by andyrav »

Hi
Can you point me in the write direction
i can get it to be closed on the login page, but then once logged in it is still closed. i would like it open after you log in

thanks


SOHIB
User
Posts: 111

Post by SOHIB »

simply you can tick no heard/footer while generating in front of login.php


onoboa
User
Posts: 94
Location: Guayaquil - Ecuador

Post by onoboa »

Hi,

I use this code in Client Scripts -> Other -> Login Page -> Client Script

$('[data-widget="pushmenu"]').PushMenu('collapse'); 
$(".main-header").remove();

to restore to default in another pages.

Client Script -> Global -> Pages with header/footer

$('[data-widget="pushmenu"]').PushMenu('expand');

PHPMaker v2021

I hope it helps you,

Omar


andyrav
User
Posts: 664

Post by andyrav »

tried adding

$('[data-widget="pushmenu"]').PushMenu('expand');

to client,starup and global
but it does not reopen the left menu bar

any ideas?
thanks


mobhar
User
Posts: 11905

Post by mobhar »

You may simply put this following code in Client Scripts -> Global -> Pages with header/footer -> Startup Script:

if (ew.IS_LOGGEDIN)
	$('[data-widget="pushmenu"]').PushMenu('expand');

then make sure you have already re-generated ALL the script files, and try again.


DGarza
User
Posts: 152

Post by DGarza »

mobhar wrote:

if (ew.IS_LOGGEDIN)
 	$('[data-widget="pushmenu"]').PushMenu('expand');

There is a little problem with this, when you open de page on a mobile, the side bar always appear when you regresh de page, you need to add a condition of the screen px or something before


thomas
User
Posts: 137

Post by thomas »

Is there any option to totally HIDE or Remove the Side Bar from the Login Page only including the 3 line Menu Icon.


sticcino
User
Posts: 1090

Post by sticcino »

add:

$("body").addClass("sidebar-collapse"); // hide sidebar

to your Other -> Login Page -> Client Script


thomas
User
Posts: 137

Post by thomas »

On the Advance Setting -> AdminLTE layout class I am using layout-navbar-fixed
and also I have put this code at Startup Script under Client Script -> Global -> Pages with header/footer

$('[data-widget="pushmenu"]').PushMenu('collapse');

In this case I would like to hide the sidebar totally only on the login page
including the 3 line menu icon on the Top Left.

sticcino wrote:

$("body").addClass("sidebar-collapse"); // hide sidebar

It does not work


Post Reply