Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove <navigation> from Forum Index
#1
Question 
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!
Reply
#2
http://community.mybb.com/thread-62629.html
http://community.mybb.com/thread-35415.html

Either one of the methods will work just fine.
Reply
#3
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";
} 
[Image: hdoE.png]
m1ne.net - coming soon
Reply
#4
+rep to both of you, thanks!
Reply
#5
(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) ?
Not in this land alone,
But be God's mercies known,
From shore to shore!
Lord make the nations see,
That men should brothers be,
And form one family,
The wide world ov'er

Reply
#6
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;
}
Hey man, what's up?
Reply
#7
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]
[Image: YZ84XVq.gif]
Reply
#8
(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
Reply
#9
(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>
[Image: YZ84XVq.gif]
Reply
#10
(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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)