SimplePortal

Customization => Custom Coding => Topic started by: AciD on April 27, 2010, 02:35:08 PM

Title: Remove menubar on portal
Post by: AciD on April 27, 2010, 02:35:08 PM
Hi,

How can i remove (http://j.imagehost.org/0818/Obrazek1.jpg) menu and navigation bar on portal?
Title: Re: Remove menubar on portal
Post by: Old Fossil on April 27, 2010, 05:04:14 PM
Do you mean the menu bar at the top of the page?
Title: Re: Remove menubar on portal
Post by: AciD on April 27, 2010, 08:00:49 PM
Yes, and navigation bar.
Look screenshot (http://j.imagehost.org/0818/Obrazek1.jpg)
Title: Re: Remove menubar on portal
Post by: Old Fossil on April 27, 2010, 08:03:55 PM
I may be wrong BUT I think it may not be possible.

SP is added to the forum as a mod so removing the menubar would remove the menu from all the pages within the forum and not just the portal.
Title: Re: Remove menubar on portal
Post by: AngelinaBelle on April 27, 2010, 08:53:20 PM
It could be done. SimplePortal itself can figure out if it should be showing the portal page. So this same detection could be applied in a template layer.
 
I don't know the guts of SMF and SimplePortal as well as the devs and experienced customizers. I think you could try modifying template_menu with something like
Code: [Select]
if ( sportal_catch_action == 'sportal_main' ) return;
Title: Re: Remove menubar on portal
Post by: Nathaniel on April 28, 2010, 03:24:57 AM
How you do this, will depend on the theme that you are using...

Here is my solution for the default curve theme (SMF 2 only):
Code: ("Find (Theme/default/index.template.php)") [Select]
// Show the menu here, according to the menu sub template.
template_menu();

echo '
<br class="clear" />';

// Show the navigation tree.
theme_linktree();


Code: ("Replace") [Select]
// Show the menu here, according to the menu sub template.
if (empty($context['main_portal_page']))
{
template_menu();

echo '
<br class="clear" />';

// Show the navigation tree.
theme_linktree();
}

Code: ("Find (Sources/PortalMain.php)") [Select]
$context['page_title'] = $context['forum_name'];
Code: ("Replace") [Select]
$context['page_title'] = $context['forum_name'];
$context['main_portal_page'] = true;
Title: Re: Remove menubar on portal
Post by: AciD on April 28, 2010, 09:07:48 AM
Thank you very much Nathaniel!
It works, result (http://j.imagehost.org/0636/spnobar.jpg).
Title: Re: Remove menubar on portal
Post by: AngelinaBelle on April 28, 2010, 06:56:35 PM
The image you posted doesn't work, though. I was eager to see what you'd done with the idea.
Title: Re: Remove menubar on portal
Post by: Nathaniel on April 28, 2010, 07:28:55 PM
The image works fine for me...

Looking good AciD. :)
SimplePortal 2.3.8 © 2008-2024, SimplePortal