customize menu link color on 1 page

hjk / 2012-02-08 16:24:33   

Hi, is it possible to make the menu link colors different on different pages like this: www.adambartos.com
On the first (splash) page, the menu on the left is white and yellow when hovered, then once you enter the site, the menu changes to dark gray. I'm trying to replicate this with indexhibit, not sure if it's possible.
Thanks!

hjk / 2012-02-08 16:25:09   

Sorry here's the Webpage
Thanks!

ruggero / 2012-02-09 07:50:23   

the only way i could think is to insert , in the page you want to edit, the reference to a new .css file with the new colors.
Mybe it will overwirite the default style.css rules, but I don't know if you can insert a element in the indexhibit page editor...

ruggero / 2012-02-09 07:51:39   

*insert a STYLE element..

pernin / 2012-02-09 07:54:54   

www.adambartos.com is not an indexhibit site

hjk / 2012-02-09 09:08:42   

@pernin, I know it's not, I'm trying to replicate the site as much as i can using indexhibit.
@ruggero, i'll try that, not sure if it will work but thanks.

pernin / 2012-02-09 11:42:10   

well, in that case, where is your website? please, read the forum rules, thank you

hjk / 2012-02-09 13:19:13   

oh yes sorry, my site is Webpage
created with indexhibit.
I'm trying to migrate this other site to indexhibit as well.

pernin / 2012-02-09 13:37:54   

Check the Useful Threads in the forum: 'How to change color of links'

hjk / 2012-02-09 14:21:38   

It might be useful if I included the link to the site I'm working on, duh. Here it is:
Webpage
The home page has a background color (mustard). I want to use this color throughout the site as the hover and link color (which I know how to do) but on the home page menu, I have to change the hover color to something else so that it shows up, but only on that page.
My question is, is it possible to change the menu colors just on one exhibit page (namely the home page in this case).
Whew, thanks.

hjk / 2012-02-09 15:29:01   
  1. So I thought I could use this to make the menu color on just the first page/exhibit white:
  2. body#section_id_1 #menu ul li.section-title { color: #fff; }
  3. But it doesn't work. Am I trying to do something that's not possible this way? Thanks.
pernin / 2012-02-09 15:40:18   

Now I get it... ;)

My first thought is that you need a different style.css for the main page: maybe write a plugin in php, call it only in the main page and have it load that style? There's a tutorial on how to write a plugin

hjk / 2012-02-09 16:22:36   

OK so there is no other way to do it other than write a plugin? Argh.
Just wanted to check before I attempt it. Anyone else?

pernin / 2012-02-10 01:56:19   

menu, or in your case, ul properties are the same for every page, so when you need to modify these properties for just one page, the way to do it would be by adding some dynamic css to the exhibition plugin you use for that page -- save the plugin with some other name, so that it doesn't affect other pages using the same plugin but without the same effect

add this to the plugin, or just build one exclusively for this if you're not going to have any exhibition on that page. For example, like this:

at the beginning of the file, you may need to define defaults from general libraries (not sure this is strictly necessary for this, but it doesn't hurt):

$exhibit['dyn_css'] = dynamicCSS();

and the you can define your function for dynamic css, somewhere near the end of the plugin:

function dynamicCSS()
{
return "#menu { background-color: #A0E3F9; }
#menu ul li.section-title { color: #330066; font-size: 1.2em; } ";
}

Check a few of the plugins to see how they are written, for example exhibit.over_and_over.php. There are also variations that would also work well for what you want to do, for example: exhibit.horizontal.php

This thread has been closed, thank you.