-
Re: Categories Dressing
Relentless -
What you posted will essentially include the href twice, and have no class tag for the link.
<a href="http://www.samplewebsite.com/index.php?main_page=index&cPath=28">' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">
ht tp://ww w.samplewebsite.com/index.php?main_page=index&cPath=28
is exactly what
zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path'])
evaluates to, so you would get in execution
<a href="http://www.samplewebsite.com/index.php?main_page=index&cPath=28">http://www.samplewebsite.com/index.php?main_page=index&cPath=28">
-
Re: Categories Dressing
I have not worked with class and herf in php before.
I think I am close.
------------
<?php
{
case '28': //replace number with your desired cPath
$content .= '<a class="'. a.catBoxHeading1 . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">'>Air Conditioning<br /> Split System<br /> Ducted<br /></a>' . $disp_block_head) . "\n";
break;
}
?>
-------------
This is the css
.catBoxHeading1 {
font-family: arial,verdana,helvetica, sans-serif;
font-weight: bold;
font-size: 1em;
color: #00DD00;
margin-top: 2px;
margin-bottom: 2px;
padding-top:2px;
padding-bottom:2px;
margin-left:-6px;
}
a.catBoxHeading1:visited {
font-family: arial,verdana,helvetica, sans-serif;
font-weight: bold;
font-size: 1em;
color: #00CD00;
margin-top: 2px;
margin-bottom: 2px;
padding-top:2px;
padding-bottom:2px;
margin-left:-6px;
}
a.catBoxHeading1:hover {
font-family: arial,verdana,helvetica, sans-serif;
font-weight: bold;
font-size: 1em;
color: #000000;
margin-top: 2px;
margin-bottom: 2px;
padding-top:2px;
padding-bottom:2px;
margin-left:-6px;
}
a.catBoxHeading1:active {
font-family: arial,verdana,helvetica, sans-serif;
font-weight: bold;
font-size: 1em;
color:#FF0000;
margin-top: 2px;
margin-bottom: 2px;
padding-top:2px;
padding-bottom:2px;
margin-left:-6px;
}
Thank You
Relentless
-
Re: Categories Dressing
Using [php] tags in your post will show up certain coding errors:
PHP Code:
$content .= '<a class="'. a.catBoxHeading1 . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">'>Air Conditioning<br /> Split System<br /> Ducted<br /></a>' . $disp_block_head) . "\n";
catBoxHeading1 is not a php entity, but an html tag, and is nothing but another text string to php.
You don't want the single quote before the >, as that will tell php that the text string is finished and the rest is php code.
PHP Code:
$content .= '<a class="catBoxHeading1" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">>Air Conditioning<br /> Split System<br /> Ducted<br /></a>' . $disp_block_head) . "\n";
The css looks good, although you don't need to spell out so much. The first set is ok, but the rest differ only in the color, and don't need to have the rest of the properties mentioned. They will be inherited from the link declaration unless specifically changed.
a.catBoxHeading1:visited {
color: #00CD00;
}
-
Re: Categories Dressing
Thanks a lot gjh42! This solution worked very well and I resolved my problem. Thanks again...
Silvio.
-
Re: Categories Dressing
/*I see that I have arrived back at your original PHP code entry,
now it makes sense, is this correct, to put in tpl_categories.php. */
<?php
case '28': //replace number with your desired cPath
$content .= '<a class="catBoxHeading1" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">>Air Conditioning<br /> Split System<br /> Ducted<br /></a>' . $disp_block_head) . "\n";
break;
?>
--------
This is the css
.catBoxHeading1 {
font-family: arial,verdana,helvetica, sans-serif;
font-weight: bold;
font-size: 1em;
color: #00DD00;
margin-top: 2px;
margin-bottom: 2px;
padding-top:2px;
padding-bottom:2px;
margin-left:-6px;
}
a.catBoxHeading1:visited {
color: #00CD00;
}
a.catBoxHeading1:hover {
color: 000;
}
a.catBoxHeading1:active {
color: #f30;
}
Thank You
Relentless
-
Re: Categories Dressing
That looks correct. Try it and see!
-
Re: Categories Dressing
I got this error
Parse error: syntax error, unexpected ')' in
/home2/xxxxxx/public_html/includes/templates/zencart_zen/sideboxes/tpl_categories.php on line 47
Line 47 is part of this PHP, I do not see the ')'
------This caused the error. I commented the original PHP, in case of an error.
// categories dressing - add (divider and) heading above a cat
$disp_block_head = '';
//$disp_block_head = '<br />'; // for heading not block uncomment this line
switch ($current_path) {
case '28': //replace number with your desired cPath
$content .= '<a class="catBoxHeading1" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">>Air Conditioning<br /> Split System<br /> Ducted<br /></a>' . $disp_block_head) . "\n";
//$content .= '<hr class="catBoxDivider" />' . "\n"; // to add divider uncomment this line
//$content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead' . $current_path . '.gif') ? //zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead' . $current_path . '.gif') . '</span>':'>Split System<br /> Air Conditioning<br /> //Ducted<br /></span>' . $disp_block_head) . "\n";
break;
Thank You
Relentless
-
Re: Categories Dressing
With the deletion of
. (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead' . $current_path . '.gif') ? //zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead' . $current_path . '.gif') .
the ) after $disp_block_head should have been removed also. I missed that in the original simplification.
-
Re: Categories Dressing
@ Glenn
Thank you for helping out!
-
Re: Categories Dressing
The Categories Dressing Heading link is working,
.catBoxHeading1 css line 911 the [color: #00DD00;] not working.
It's the color that makes the Heading
the color is inherited from the a:link, css line 23 with color:ff11bb;
now the heading is the same #color as the Category links.
Is there a fix for this?
Or is it a matter of a total css link overhaul.
Thank You
Relentless