Forums / Templates, Stylesheets, Page Layout / How do I bold my at links in the footer?

How do I bold my at links in the footer?

Locked

Views: 732

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
18 May 2010, 12:24 PM
#1
webman10 avatar

webman10

New Zenner

Join Date:
May 2010
Posts:
5
Plugin Contributions:
0

How do I bold my at links in the footer?

I need my at links to be bolded on the footer. My code in tpl_ezpages_bar_footer.php is below, the problem is with the if statements, the first EZ Pages menu item shows up in bold on that page, but on each page after that, no bolded at links. I'm guessing this has something to do with conditional statements inside the for loop.

include(DIR_WS_MODULES . zen_get_module_directory('ezpages_bar_footer.php'));
?>

<?php // NW EDIT $uri = $_SERVER['REQUEST_URI']; $uri_ez = 'http://www.sapphirebaking.com' . $uri; ?> <?php if (sizeof($var_linksList) >= 1) { ?> <?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { ?> <?php echo ($i <= $n ? EZPAGES_SEPARATOR_FOOTER : '') . "\n"; ?> <?php // NW EDIT if ($uri_ez == $var_linksList[$i]['link']) { echo '<li id="foot_menu_item_at">'; } elseif ($uri_ez != $var_linksList[$i]['link']) { echo '<li class="foot_menu_item">'; } ?>

<a class="foot_menu_link" href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a></li>

<?php } // end FOR loop ?> <?php } ?>

Thanks in advance,

webman

18 May 2010, 1:29 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How do I bold my at links in the footer?

Keep out of the raw PHP... !

Styles are applied in the stylesheets.

Use firefox browser with firebug plugin to do offline analysis of your displayed page. Firebug will reveal the style CLASSES and ID's governing any specific DIV.

Then, use CSS declarations to style that div.

NO NEED TO HACK AT THE CODE ! :shocking:

20 years a Zencart User

18 May 2010, 2:58 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I bold my at links in the footer?

The original code doesn't have a way to identify the current ez-page link, so some code modification would be necessary there.

18 May 2010, 4:36 PM
#4
webman10 avatar

webman10

New Zenner

Join Date:
May 2010
Posts:
5
Plugin Contributions:
0

Re: How do I bold my at links in the footer?

First, thank you for the responses. Sorry I was so slow to respond.

In this case there are no classes or ids defined for the actual LI list item (which I need to use as I did outside the cart) but I can change the UL unordered list with plain HTML and then use

UL#menu_list > li to change the styles. -> possible compatibility issues

BUT,
this strategy doesn't allow me to use different styles for different pages, what I need is the Privacy link to be bold on the privacy page and only the privacy page, the terms on the terms page etc.

Fresh idea, to stay out of the PHP (good advice), I could set a separate stylesheet for each page on the EZ pages menu, making sure that I use precedence rules to override the main stylesheet.

STILL,
not sure this will work because each LI list item would require a separate ID.

I'll give this a whirl and post back here.

webman10

18 May 2010, 4:58 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How do I bold my at links in the footer?

I manage to style the EP footer links no problem... bold, italic, red, blue, pink, large, small, underline.....

There are serveral levels...

#navSupp {}

#navSupp ul li {}

#navSupp ul li a {}

20 years a Zencart User

18 May 2010, 5:36 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I bold my at links in the footer?

You can style the links differently by using adjacent selectors to affect first, second, third, etc. items:
#navSupp ul li a {}
#navSupp ul li+li a {}
#navSupp ul li+li+li a {}
...

This still doesn't address the current page issue, but you can combine it with per-page stylesheets for ez-pages and it actually could get the desired current page styling without PHP coding.
Note that this will not work in IE6 as it doesn't support adjacent selectors.
It also would need to be manually adjusted if your ez-page footer links change.

18 May 2010, 6:44 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How do I bold my at links in the footer?

I really don't know if this will help, but in the PURE_BLACK template produced by a group called zen-cart-power, they have a template file called tpl_top_nav.php that uses a BG image to indicate an AT page.

So, in their standard header menu, there are links such as "New Products" and the link has a hover background (controlled in the stylesheets)... and when you select the link, the BG image remains "on"... if you see what I mean

Anyway... here's an example of the PHP they use to create that effect..

<div id="top_nav">
<div id="tab_nav">
<!--<div class="top-nav-left"></div>-->
<div class="top-nav-right"></div>
	<ul class="list-style-none">
		<li class="home-link"><a href="<?php echo '' . HTTP_SERVER . DIR_WS_CATALOG;?>"><!--img src="images/spacer.gif" width="1" height="14" alt=""--></a></li>

<?php
if ($current_page_base == 'products_new') {	$active	= 'tab_active'; 
	} else { $active = '';
}?>
		<li id="<?php echo $active;?>"><a href="index.php?main_page=products_new"><?php echo TOP_MENU_NEW_PRODUCTS;?></a></li>

<?php
if ($current_page_base == 'specials') { $active = 'tab_active'; 
	} else { $active = '';
}?>
		<li id="<?php echo $active;?>"><a href="index.php?main_page=specials"><?php echo TOP_MENU_SPECIALS;?></a></li>

<?php
if ($current_page_base == 'account' || $current_page_base == 'login' || $current_page_base == 'account_edit' || $current_page_base == 'address_book' || $current_page_base == 'account_password' || $current_page_base == 'account_newsletters' || $current_page_base == 'account_notifications') { $active = 'tab_active'; 
	} else { $active = '';
}?>
		<li id="<?php echo $active;?>"><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo TOP_MENU_MY_ACCOUNT;?></a></li>

<?php
if ($current_page_base == 'shopping_cart') { $active = 'tab_active'; 
	} else { $active = '';
}?>
		<li id="<?php echo $active;?>"><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo TOP_MENU_VIEW_CART;?></a></li>
	</ul>
</div>

Please note... this is CUSTOM code from zen-cart-power and is possibly subject to copyright.

20 years a Zencart User

18 May 2010, 7:25 PM
#8
webman10 avatar

webman10

New Zenner

Join Date:
May 2010
Posts:
5
Plugin Contributions:
0

Re: How do I bold my at links in the footer?

Thank both of you for the help, still no solution, I'm currently working (and having a helluva time) on descendant, child, adjacent selectors, using every possible combination. I can bold them all this way but not just one (problem with adjacent). I'll post final solution, if you have any more suggestions I'll check them out.
-webman

19 May 2010, 12:41 AM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I bold my at links in the footer?

Say you want to bold only the third link.```
#navSupp ul li a {font-weight: normal;}
#navSupp ul li+li+li a {font-weight: bold;}
#navSupp ul li+li+li+li a {font-weight: normal;}

The four li rule will apply to the fourth and following items.
19 May 2010, 9:34 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How do I bold my at links in the footer?

gjh42:

Say you want to bold only the third link.```
#navSupp ul li a {font-weight: normal;}
#navSupp ul li+li+li a {font-weight: bold;}
#navSupp ul li+li+li+li a {font-weight: normal;}

> The four li rule will apply to the fourth and following items.

Glenn... your superior brain just astounds me sometimes.. such an elegant solution!

20 years a Zencart User