Topic: Nav link colors

If I have additional links on my nav area and I want them change color when I actually click on it. How would I go about doing that without editing the functions file.

The functions file only contains the standard links that comes with pun such as index, search, profile etc...

Re: Nav link colors

This should help you Bing.

~James
FluxBB - Less is more

Re: Nav link colors

Well, not really. For example I have thi sin my extra links:

1 = <a href="blogs.php">Blog</a>
2 = <a href="forum.php">Forum</a>
3 = <a href="chatbox.php">ChatBox</a>
8 = <a href="Links.php">Links</a>
10 = <a href="contact.php">Contact Us</a>
11 = <a href="online.php">Online</a>

4

Re: Nav link colors

well its a html box.. so just style them with style=""

1 = <a style="color:#ff0000" href="#">Hmmm</a>

smile

Re: Nav link colors

This won't work for me. I think you misunderstood what I am asking. I may not be explaining it properly. I'll try again.

Lets say I have Index - Forum - Downloads. I click on Index and it is shaded as "red", now I click on Forum and that is now "red" but Index is now "white"...Hope you follow.

Bingiman

6

Re: Nav link colors

So that they only change colour whilst you are on the respective page for that navbar link you mean? If so, look through the CSS code for that tabs mod. That does the same thing, just in a different fashion.

Re: Nav link colors

I will try that but I am not sure if that recognizes external links. I woul dhave thought that the id navextra would do that. Maybe some code should be written for that to recognize all external links to use that.

Re: Nav link colors

u would have to assign each one(link) an id in the functions.php and the code each link there color and the A:hover,active,visited in the css.


Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Nav link colors

I know that, and this is what I was trying to avoid.

10

Re: Nav link colors

bingiman wrote:

to recognize all external links to use that.

If you look in the source on each page, each page is prefixed with pun[pagename], minus the .php extension.

Out of curiosity though, how can you style external links? Or, are you meaning external in a different context to what I'm interpreting? big_smile

Re: Nav link colors

Well, what I mean when I say external links is the extra links. So in my case I have <a href="blogs.php">Blog</a> with no id there it is impossible to accomplish what I want to do, unless I add it to the functions file. That sorta defeats the purpose of it all. I didn't wnat to have to add a new link each time to functions.

12

Re: Nav link colors

i mean index.php forum.php blog.php...etc

question....
when u add a link and it goes in the db  say jump.php uses jump
in the functions.php index has
id="navindex"  and that can be done in the css
since that! could there be a mod that will pull the link name "jump and assign it to the id="nav<?echo name?>" so it would produce id="navjump"
then in the css u could add the navjump code?

Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

13 (edited by bingiman 2008-01-19 15:30)

Re: Nav link colors

That would be a great idea actually. As for the 1st part of your response. I did not want to add those links to the functions file.

Scot, I think you should start coding this idea. big_smile

14

Re: Nav link colors

You don't need to touch functions.php at all. Forget the functions file. CSS, yes, functions, no. Again, look in your page source. The id is already there. For example, with the blogs which you mentioned:

<div id="punblogs" class="pun">

Re: Nav link colors

Hi Matt,

This is what I have as an example. So how would I use for the blogs based on what you said above.

#punindex        #brdmenu li#navindex a, 
#punuserlist     #brdmenu li#navuserlist a, 
#punnews         #brdmenu li#navnews a,
#pundownloads    #brdmenu li#navdownloads a,
#punuploadimg     #brdmenu li#navuploadimg a, 
#punprofile      #brdmenu li#navprofile a, 
#punadmin        #brdmenu li#navadmin a,
#punregister     #brdmenu li#navregister a, 
#punmessage_list  #brdmenu li#navmessage_list a, 
#punlogin        #brdmenu li#navlogin a, 
#punsearch       #brdmenu li#navsearch a
{    font-weight: bold;
    color: #0049a4;
    background-color: inherit;
}

16

Re: Nav link colors

Just add a punblogs line:

#punsearch       #brdmenu li#navsearch a,
#punblogs       #brdmenu li#navblogs a

and then do whatever you want with that CSS.

Re: Nav link colors

That does not work.

18

Re: Nav link colors

Does it work with the other links assigned in that tabs.css file?

Re: Nav link colors

yes, and it only works with those that are also assigned id's in the functions file.

20 (edited by MattF 2008-01-19 16:23)

Re: Nav link colors

A slight alteration may need making to the navlink inclusion in the functions file, just to generate the id. I'll have a peek later.

Edit: Come to think of it, why don't you just add an id to each <a tag in the extra links input box?

Re: Nav link colors

I could do that but what would separate it from when I click on the link and when I don't?

22

Re: Nav link colors

You're working on a combination of div id and href id. Unless that page is active, that div id won't exist.

Re: Nav link colors

Well, I assigned an id to the link in the additional links window and setup the style for it. There was no effect.

24

Re: Nav link colors

And the id does match: navblogs? If so, there's no reason why it shouldn't be working. Make sure the containing div id and <a tag id match and that should work.

25 (edited by quaker 2008-01-19 20:12)

Re: Nav link colors

i think that if i could do that mod. it would work great with my additional navbar for the side bar.
hehehe


Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!