No problems on not wanting to use the plugin,
irontongue - just thought I'd toss that out as an easy option.
As for your custom navbar, because you want some links permitted for certain users, it'll take some work on your part. Using the 3 stock Member Groups that
Retread posted above, let's set up a short navbar that uses those (restricting navbar link of who can see and use by group).
1. <div class="mynavbar">
2. <ul style="display: inline;">
3. <li><a href="/">Home</a></li>
4. {if $[current_user.group.name"] == "Administrator" || $[current_user.group.name] == "Global Moderator || $[current_user.id] == 1}
5. <li><a href="/members">Members</a></li>
6. {/if}
7. {if $[current_user.group.name"] == "Administrator" || $[current_user.id] == 1}
8. <li><a href="/admin">Admin</a></li>
9. {/if}
10. ... (run other navbar links similarly here)
11. </ul>
12. </div>
I added line numbers ONLY for reference - they do NOT get added to the actual code. So, let's break this down:
Line 1 - makes the <div> for your navbar. You can name your class anything you want - I just used
mynavbar for the example.
Line 2 - This starts the unordered list that will be our navbar links.
Line 3 - There's no {if} statement because we want everyone to be able to use the
Home link.
Line 4 - This is checking to see if the member's display group is set to
Administrator or
Global Moderator. It also checks to see if it's the root admin.
Line 5 - If the current user is an Administrator, Global Moderator or is the root admin, then we show the link for
Members.
Line 6 - closes our {if} from Line 4
Line 7 - Checks to see if the current user's display group is
Administrator or if it's the root admin.
Line 8 - If Line 7 is true, then show the
Admin link.
Line 9 - closes our {if} from Line 7
Line 10 - basically rinse and repeat for the rest of your navbar links. No {if} is needed if the link is for everyone.
Line 11 - closes our unordered list
Line 12 - closes our <div>
NOTE: You may have noticed I stated
current users display group. This is important because the templates ONLY see what the member has as their current Display Group (
Profile > Edit Profile > Settings (tab) > Display Group (option)) - even if they belong to more than 1 group. So, if you have a Global Moderator who may also be, for example, an RP Moderator - and that user has the RP Moderator as their current Display Group - they won't see any links that the Global Moderator can because Global Moderator isn't their current displayed group. You would need to use JS in order to get all of the groups a user belongs to - to where it can act based on whether a user is in a certain group or not, even if it isn't their current displayed group (my Navbar Links plugin does this).
Another thing to watch out for, is that I've seen mention that you are limited in some things in the templates. I'm not 100% sure, but I think there's a limit on how many {if}'s you can have and possibly a max character count. Maybe
Kami knows more about that.
Hopefully this is enough to get you started in making your custom navbar.
EDIT:
The reason I added a class in Line 1 is so that you can target it with CSS in your stylesheet. Something like:
.mynavbar {
color: #ffffff;
background-color: #000000;
border: 1px solid #ffffff;
}
.mynavbar a:hover {
color: #009600;
background-color: #cccccc;
}
The above is only there as an example - I have no idea how well those colors would work together.
EDIT #2: Okay - you may need someone to help with keeping it horizontal, as my
<ul style="display: inline;"> doesn't seem to work. Sorry.
EDIT #3: Okay, so I got it to work. I've left the line numbers out of this, but here's a working example:
<div class="mynavbar">
<div class="nav-table">
<div class="navbar-list">
<ul id="nav-list">
<li><a href="/">Home</a></li>
{if $[current_user.group.name] == "Administrator" || $[current_user.group.name] == "Global Moderator" || $[current_user.id] == 1}
<li><a href="/members">Members</a></li>
{/if}
{if $[current_user.group.name] == "Administrator" || $[current_user.id] == 1}
<li><a href="/admin">Admin</a></li>
{/if}
</ul>
</div>
</div>
</div>
and here's some CSS for it:
.mynavbar {
height: 84px;
}
.nav-table {
display: table;
margin: 0 auto;
}
ul#nav-list {
list-style: none;
padding-top: 20px;
}
ul#nav-list li {
display: inline;
}