MyBB Community Forums

Full Version: Remove <navigation> from Forum Index
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

I'd like to remove the <navigation> from my Forum's header but only from the HOME page yet keep navigation in all the other threads. Currently my board shows the CSS styling for the nav even though I don't use it on the Index.

Thanks!
In your root folder, open global.php, find the following,

$navbits = array();
$navbits[0]['name'] = $mybb->settings['bbname_orig'];
$navbits[0]['url'] = $mybb->settings['bburl']."/index.php"; 

Replace with,

if(THIS_SCRIPT != "index.php") {
$navbits = array();
$navbits[0]['name'] = $mybb->settings['bbname_orig'];
$navbits[0]['url'] = $mybb->settings['bburl']."/index.php";
} 
+rep to both of you, thanks!
(2011-07-10, 10:23 PM)Solidus Wrote: [ -> ]In your root folder, open global.php, find the following,

$navbits = array();
$navbits[0]['name'] = $mybb->settings['bbname_orig'];
$navbits[0]['url'] = $mybb->settings['bburl']."/index.php"; 

Replace with,

if(THIS_SCRIPT != "index.php") {
$navbits = array();
$navbits[0]['name'] = $mybb->settings['bbname_orig'];
$navbits[0]['url'] = $mybb->settings['bburl']."/index.php";
} 
that is good but can you remove a portion of the array so if you had gone catagory /forum ( home / catagory /forum) to read just (home / forum) ?
I'm just curious, but why not just use a css attached to index to hide like home breadcrumb?
Seems easier than doing a core edit.

#breadcrumb {
display:none;
}
This is how I removed it. First of all, install template conditionals plugin, then open nav template and edit it, replace it with following code:
<if $_SERVER['REQUEST_URI'] != '/' then>
<div class="navigation">
{$nav}{$activesep}{$activebit}
</div>
</if>
To prevent duplicate URLs for forum homepage (/ and /index.php), personally I'm using this rule in public_html/.htaccess, which is working with my apache server:
RewriteRule ^index\.php$ / [L,R=301]
(2020-03-31, 08:39 AM)ILUXA Wrote: [ -> ]This is how I removed it. First of all, install template conditionals plugin, then open nav template and edit it, replace it with following code:
<if $_SERVER['REQUEST_URI'] != '/' then>
<div class="navigation">
{$nav}{$activesep}{$activebit}
</div>
</if>
To prevent duplicate URLs for forum homepage (/ and /index.php), personally I'm using this rule in public_html/.htaccess, which is working with my apache server:
RewriteRule ^index\.php$ / [L,R=301]

A good way but CSS can handle this in an easier fashion. If you give index page template a pageid, than you can hide the navigation just for index page as you can access navigation as child class of pageid.

Regards
WallBB
(2020-03-31, 10:06 AM)WallBB Wrote: [ -> ]A good way but CSS can handle this in an easier fashion. If you give index page template a pageid, than you can hide the navigation just for index page as you can access navigation as child class of pageid.
Why I also chose this solution and not CSS, because I'm using h tags inside nav template and I don't want them to be in my homepage code with display: none; CSS style, because it may be bad for SEO. My every thread page navigation looks like this:
<div class="navigation">
	<a href="https://homepage">Homepage Title</a> &raquo;

<h2 class="smalltext"><a href="forum-link">Forum Title</a></h2> &raquo;

<h2 class="smalltext"><a href="subforum-link">Subforum Title</a></h2> &raquo;

<span class="active">
	<h1 class="mediumtext"><a class="active" href="current-page-thread-link">Thread Title</a></h1>
</span>
</div>
(2011-07-29, 08:53 PM)JimR Wrote: [ -> ]that is good but can you remove a portion of the array so if you had gone catagory /forum ( home / catagory /forum) to read just (home / forum) ?

xThreads adds a forum option to hide parent breadcrumbs.
Pages: 1 2