Altering the Navigation Menu

Discuss phpwcms here, please do not post support requests, bug reports, or feature requests! Non-phpwcms questions, discussion goes in General Chat!
evan
Posts: 31
Joined: Sun 28. Mar 2004, 22:57

Post by evan »

The code you're going to need to modify is in /phpwcms/include/inc_front/front.func.php around line 900 or so. That's the code that generates the nav menus.

You need to find this line: (it's line 898 in my copy of the file but that may be different on yours)

Code: Select all

$js .= ($nav_table_struct["row_over_bgcolor"]) ? "this.bgColor='".$nav_table_struct["row_over_bgcolor"]."';\"" : '"';
and change it to:

Code: Select all

$js .= "this.className='navtableover';"
then replace the line two below it:

Code: Select all

$js .= ($nav_table_struct["row_norm_bgcolor"]) ? "this.bgColor='".$nav_table_struct["row_norm_bgcolor"]."';\"" : '"';
with

Code: Select all

$js .= "this.className=' *** WHATEVER THE NORMAL CELL CLASS IS *** ';"
then you need to make a class "navtableover" and give it whatever attributes you want the mouseover'd menu to have.
eglwolf
Posts: 70
Joined: Mon 12. Apr 2004, 01:23

Post by eglwolf »

Ok now I get it, I will try that and let you know, thanks.
eglwolf
Posts: 70
Joined: Mon 12. Apr 2004, 01:23

Post by eglwolf »

Well I tried this, and got javascript errors on the page, then I added the ; at the end of each replacement line. Still got javascript errors.

So what I tried next was to change

Code: Select all

$js .= ($nav_table_struct["row_over_bgcolor"]) ? "this.bgColor='".$nav_table_struct["row_over_bgcolor"]."';\"" : '"';
to:

Code: Select all

$js .= ($nav_table_struct["row_active_class"]) ? "this.className='".$nav_table_struct["row_active_class"]."';\"" : '"';

I then change the conf.default_template.inc from using the color code to use the css.

I created the styles in the frontend.css. And everything works - EXCEPT for the borders. They still would not show up.

Very strange. Here are the styles I created:

Code: Select all

.nav_row_norm {background:#F0F0F0; border:1px solid #F0F0F0;}
.nav_row_over {background:#CCCCCC; border:1px solid #000000;}
The background colors showed up fine, just no borders.

Not sure what else to try.... :?
evan
Posts: 31
Joined: Sun 28. Mar 2004, 22:57

Post by evan »

sorry about the errors in my code, I didn't really test it or anything... but you seem to have figured it out. I'm looking at the URL you posted earlier and it's still got this.bgColor="" rather than this.className="" in it... that's why your background colors are working but the CSS stuff isn't. Are you sure you uploaded the right file?
eglwolf
Posts: 70
Joined: Mon 12. Apr 2004, 01:23

Post by eglwolf »

well I put it all back to the orginal, since the this.className worked, but the border would not show up. The background worked just like before however the border would not. it is very strange..
Post Reply