MyBB Community Forums

Full Version: Navigation bar link only on index?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Not talking about the sites header navigation but the navigation bat with breadcrumbs and user cp logout etc.

I added a sidebar collapse link in the code of:

<span class="nav_link"><a class="buttons" title="Collapse sidebar"><i class="fa fa-toggle-right"></i> Collapse Sidebar</a>
<a class="clickedbuttons" title="Expand sidebar"><i class="fa fa-toggle-left"></i> Open Sidebar</a></span>

I want to limit this only to the index page where the sidebar is.
Any Advice, I know the log-in/out etc adjusts so I should hopfully be able to adjust this.
I know I need to fix the font color to match sometime.

I don't really want to put extra space in the index just for a button.

Here is how it looks on the index.

[Image: k5nbwPJ.jpg]

On non index pages it looks like this and why I want to restrict to index only.

[Image: w9raMoJ.jpg]
There is a quick workaround. Leave the link in the menu, where it is intact with a CSS property  value set to not displaying it.
<span class="nav_link" style="display: none;">
That will hide the menu item through out your site.

Now wherever you want the link to show up, in your case, as you said index, place the following code in your index template to force the menu item to show up:

<style type="text/css">
.nav_link { display: inline-block!important; }
</style>
Worked great thank you.

I can do basic edits but I am not a coder as such mainly someone who can modify stuff if its easy.

Hopefully this should help others also.
You said you are not a coder but the instructions were much technical.
I appreciate you have done the modifications properly. Honestly, many of the globe can't even follow my impatient reply.

Cheers.
(2018-05-09, 02:01 PM)effone Wrote: [ -> ]You said you are not a coder but the instructions were much technical.
I appreciate you have done the modifications properly. Honestly, many of the globe can't even follow my impatient reply.

Cheers.

Hahaha its all good,

I know a bit of html and enough css to get me by not enough to know complex rulesets and stuff with anything.
I cant do PHP or MYSQL I would love to but over my head the only actual coding I knew was a little basic only the basics and some other variable statements.
I can read brackets of text and basically follow.

I've done some basic modifications with the emerald theme to fix and just change a few things for my use and once my site is open I may link it somewhere especially in my thread about the interest and mental health site I am opening.