Styling the navigation list

esmtll / 2010-01-30 17:25:57   

I'm trying to replace each text string in the navigational list with a unique image (for example, I'm replacing "NEWS", "WRITING", "MUSIC", and "CONTACT" with images) using my CSS. I therefore need to give each list tag a unique class when the PHP calls the unordered list. I'm betting it would be easiest to edit the PHP to insert the section id when it writes the code.

I see how it was written to insert the "class='active'" string and have beeing messing around trying to get it to also call up the section id. Unfortunately, I'm not a PHP guru. So am basically asking if anyone knows the syntax for calling the section id.

Website

Vaska A / 2010-01-30 18:02:13   

There are a few threads around here with some different ideas on this kind of thing - you should give them a read.

Personally, I would rewrite the nav and do some things with CSS and dynamic images but this is rather advanced.

You could edit the navigation code (found in /ndxz-studio/site/plugin/index.php and add the section_id to the output of the section titles...it's not a bad approach at all.

Also, another (and probably better) idea is to use Cufon...search the forum for it...

esmtll / 2010-01-30 18:16:44   

Thanks Vaska
I would rewrite the navigation, too but it's rather elegant the way it is. And I'm not sure I know enough about PHP to maintain all the editability.

Editing the navigation code and adding the section_id output is exactly what I was thinking. This would make it extremely easy to do the dynamic images in CSS, something I do regularly. I just don't know the PHP end of it.

I'll look around though at some other ideas. Maybe I'll prefer them.

Vaska A / 2010-01-30 18:29:09   

I'm not at my normal computer right now or I would tell you exactly which line to look at - but I have posted it a few times around here in the past (and a few others have as well). Hopefully, you can find it.

Cufon is very nice...I think this is really the best way to go. Any typeface you want...oolala...

esmtll / 2010-01-30 18:33:53   

mm, Cufon doesn't allow hover states. That's a problem.

I've already edited /ndxz-studio/site/plugin/index.php so that I have the class (which I've filled at the moment with '$active' which now outputs "active" instead of the whole class string).

I just need the syntax to call up the section_id. Simple thing, really. I just know that little (I'm a designer, not a developer).

Vaska A / 2010-01-30 18:34:33   

Cufon does...I've done it.

But, you don't need hover states for the section titles (unless I'm not understanding things).

Tonight I seem to be sucking at helping people around here.

;)

esmtll / 2010-01-30 19:04:43   

Oh, no, you're right. That's my bad (and I have no excuse--it's the middle of the afternoon here). I'm doing this for each link in the navigation. Not the sections. I guess that would mean I'm looking to call up the page ID. I suppose that would be the same as calling up the obj_name script if I was doing this in HTML.

For example, when on the NEWS page of the site, the li tag would have a class='active news'. While still on the NEWS page, the li tag for the CONTACT link would simply be class='contact'. This make sense? Frankly, I don't really care what the string is, it just needs to be unique for each navigation link.

Sorry for the confusion.

Also on the Cufon front, I guess I'd like to stay within CSS and away from using more Javascript than necessary. Just a personal preference. Spiffy script though.

This thread has been closed, thank you.