Jump to content
gio1961

Hiide header / menu on the login and registration pages

Recommended Posts

Hi Guys, I have a problem.
For needs, I have 2 menus, one in app_top.php (for users who log in to the site) and the other app_top1.php (for users who visit the site).
I use the Crewcenter skin where the underneath code is in the layout.php file, to hide the header / menu on the login and registration pages.

 

		<?php
		// var_dump($_SERVER['REQUEST_URI']);
		if (!isset($_SERVER['REQUEST_URI']) || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/login' || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/registration') {
			if(Auth::LoggedIn()) {
				Template::Show('app_top.php');
			}
		}
		?>

        <div id="content">
            <?php echo $page_content; ?>
        </div>

		<?php

		if (!isset($_SERVER['REQUEST_URI']) || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/login' || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/registration') {
			if(Auth::LoggedIn()) {
				Template::Show('app_bottom.php');
			}
		}
		?>

 

I tried to insert this code, but the menu of the app_top1.php file is also displayed on the login / registration pages.

 

		<?php
		// var_dump($_SERVER['REQUEST_URI']);
		if (!isset($_SERVER['REQUEST_URI']) || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/login' || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/registration') {
			if(Auth::LoggedIn()) {
				Template::Show('app_top.php');
			}
			} else {
	
	            Template::Show('app_top1.php');
		}
		?>


I don't understand where the problem is

Thanks for a possible reply.
Sincerely

Share this post


Link to post
Share on other sites

Try bellow code 

 

if($this->get->page == 'login' or $this->get->page == 'registration')
{
			if(Auth::LoggedIn()) 
			{
				Template::Show('app_top.php');
			}
			else 
			{
	
	            Template::Show('app_top1.php');
			}
}

 

<?php
		// var_dump($_SERVER['REQUEST_URI']);
		if($this->get->page == 'login' or $this->get->page == 'registration')
{
			if(Auth::LoggedIn()) 
			{
				Template::Show('app_top.php');
			}
}
		?>

        <div id="content">
            <?php echo $page_content; ?>
        </div>

		<?php

		if($this->get->page == 'login' or $this->get->page == 'registration')
{
			if(Auth::LoggedIn()) 
			{
				Template::Show('app_bottom.php');
			}
}
		?>

 

Share this post


Link to post
Share on other sites
1 hour ago, Vangelis said:

Try bellow code 

 


if($this->get->page == 'login' or $this->get->page == 'registration')
{
			if(Auth::LoggedIn()) 
			{
				Template::Show('app_top.php');
			}
			else 
			{
	
	            Template::Show('app_top1.php');
			}
}

 


<?php
		// var_dump($_SERVER['REQUEST_URI']);
		if($this->get->page == 'login' or $this->get->page == 'registration')
{
			if(Auth::LoggedIn()) 
			{
				Template::Show('app_top.php');
			}
}
		?>

        <div id="content">
            <?php echo $page_content; ?>
        </div>

		<?php

		if($this->get->page == 'login' or $this->get->page == 'registration')
{
			if(Auth::LoggedIn()) 
			{
				Template::Show('app_bottom.php');
			}
}
		?>

 

 

Thanks for the reply. I tried this code but unfortunately it doesn't work. The app_top1.php file menu is not displayed

<?php
		// var_dump($_SERVER['REQUEST_URI']);
if($this->get->page == 'login' or $this->get->page == 'registration')
{
			if(Auth::LoggedIn()) 
			{
				Template::Show('app_top.php');
			}
			else 
			{
	
	            Template::Show('app_top1.php');
			}
}

		?>
        
        
        
        
        
        
        

        <div id="content">
            <?php echo $page_content; ?>
        </div>

		<?php

		if($this->get->page == 'login' or $this->get->page == 'registration')
{
			if(Auth::LoggedIn()) 
			{
				Template::Show('app_bottom.php');
			}
}
		?>

 

Share this post


Link to post
Share on other sites

if you do a 

print_r($this->get->page);

what result do you get ? i do not remember if the modules started with a capital letter

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.   Restore formatting

  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.

Loading...

×
×
  • Create New...