Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Hiding the sidebox heading fonts/links....

Hiding the sidebox heading fonts/links....

Locked

Views: 7,560

Results 1 to 20 of 29
This thread is locked. New replies are disabled.
1 Jul 2007, 2:12 AM
#1
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Hiding the sidebox heading fonts/links....

I can't seem to find what to change to hide the sidebox heading labels....(Search by category, search by manufacturer, shopping cart, login, featured items, etc.... )

I have separate images I would like to use for each of the different sidebox headings and I found this in the stylesheet which I'm assuming is what I should be looking at....

h3.leftBoxHeading, h3.leftBoxHeading a, h3.leftBoxHeading label, h3.rightBoxHeading, h3.rightBoxHeading a, h3.rightBoxHeading label {
font-size: 10px;
color: #ffffff;
}

BUT i can't figure out how to just hide the FONT. It hides the background color and everything else.............:wacko:

1 Jul 2007, 3:19 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Hiding the sidebox heading fonts/links....

Unfortunately, CSS just can't do this by itself. It could do everything except stopping the text display. You will need some coding.

In /includes/templates/your_template/common/tpl_box_default_left.php, the whole core of the file is

<!--// bof: <?php echo $box_id; ?> //-->
<div class="leftBoxContainer" id="<?php echo str_replace('_', '-', $box_id ); ?>" style="width: <?php echo $column_width; ?>">
<h3 class="leftBoxHeading" id="<?php echo str_replace('_', '-', $box_id) . 'Heading'; ?>"><?php echo $title; ?></h3>
<?php echo $content; ?>
</div>
<!--// eof: <?php echo $box_id; ?> //-->
```Change the $title to
(file_exists(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif') : $title)
```php
<!--// bof: <?php echo $box_id; ?> //-->
<div class="leftBoxContainer" id="<?php echo str_replace('_', '-', $box_id ); ?>" style="width: <?php echo $column_width; ?>">
<!--box header image  gjh42 2007-07-01-->
<h3 class="leftBoxHeading" id="<?php echo str_replace('_', '-', $box_id) . 'Heading'; ?>"><?php echo (file_exists(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif') : $title); ?></h3>
<?php echo $content; ?>
</div>
<!--// eof: <?php echo $box_id; ?> //-->
```Name images like boxhead-categories.gif and save in /your_template/images/. Look in view source to get the box id at the top of each sidebox output.

Repeat this process for tpl_box_default_right.php.

Note - it just occurred to me that this will remove the link that some headers have. There is an easy way to redo this to keep the link - I'll post as soon as I verify that it works.
1 Jul 2007, 3:58 PM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: Hiding the sidebox heading fonts/links....

Ok, tested...

In /includes/templates/your_template/common/tpl_box_default_left.php, leave the code shown above in its original state. Above it, see

// choose box images based on box position
  if ($title_link) {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
  }
//
```and replace this with```php
//box header image if file exists  gjh42 2007-07-01
$title = (file_exists(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif') : $title);
if ($title_link) {
  if (file_exists(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif')) {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . '</a>';
  } else {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
  }
}
//
```Name images like boxhead-categories.gif and save in /your_template/images/. Look in view source to get the box id at the top of each sidebox output.

Repeat this process for tpl_box_default_right.php.
1 Jul 2007, 6:12 PM
#4
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Hiding the sidebox heading fonts/links....

AWESOME!!!!
I could figure out everything except how do not display the text.
I can even hide the manufacturers heading (label) and the linked headings via the css, just not the normal headings.

Thanks for your help! I would have never figured that out.!!!

1 Jul 2007, 6:33 PM
#5
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Hiding the sidebox heading fonts/links....

ok so the only sideboxes I am still getting headings for are categories and my loginbox...

1 Jul 2007, 6:41 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Hiding the sidebox heading fonts/links....

Can you post a link to your site?

1 Jul 2007, 6:51 PM
#7
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Hiding the sidebox heading fonts/links....

http://eclecticaclothing.com
Just give me a sec to get if off of maintenance...

1 Jul 2007, 6:55 PM
#8
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Hiding the sidebox heading fonts/links....

I really appreciate your help!!!!!

1 Jul 2007, 7:08 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Hiding the sidebox heading fonts/links....

Looks like you have this pretty well in hand now... The Manufacturer heading is gone. Make up your "Shop" image for the categories header, and you should be good to go.

Did you double-check that you have the login header image named correctly?

BTW, nice looking site. It does seem that the categories navigation is not working. Is this true, or is there something else that needs to happen... nevermind, I bet you need javascript enabled for it to work. If that is the case, it wouldn't hurt to say that somewhere; or better yet, have alternate <noscript> functionality so customers can shop no matter what. That is even more important than having your cool js functions.

1 Jul 2007, 7:11 PM
#10
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Hiding the sidebox heading fonts/links....

I did double check both the categories and login images and they are named correctly, just not showing up....

1 Jul 2007, 8:24 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Hiding the sidebox heading fonts/links....

I see they are showing correctly now. What worked to make them appear?

It just occurred to me that your "shop by manufacturer" function is already there, and you only need the text changed. This can be easily fixed by searching in the Developers Toolkit for "Please Select", or better still "define Please Select".
THis should show you the language file where that text is defined, and you can edit that to read as you wish. You might check that it is not a universal constant that is used elsewhere; if so, it will be trickier to separate out.

2 Jul 2007, 8:14 PM
#12
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Hiding the sidebox heading fonts/links....

well, the categories image needed to be name boxhead-chcategories.... =)
I will try looking for that "please select" again, hopefully i can find the right one!

2 Jul 2007, 9:08 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Hiding the sidebox heading fonts/links....

I noticed that chcategories in your view source, but assumed you had accounted for it... oh well :)

Happy hunting for selects!

9 Jul 2007, 1:50 AM
#14
gjh42 avatar

gjh42

Black Belt

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

Re: Hiding the sidebox heading fonts/links....

A fix just occurred to me for a minor bug with this if there is a mix of images and non-images. If there is any padding for the text header, it will also be applied to the image header, which will generally not be desirable.
Add this to your stylesheet if this is an issue:

h3.leftBoxHeading a img, h3.leftBoxHeading label img, h3.rightBoxHeading a img, h3.rightBoxHeading label img {
    margin: -.5em -.5em;
}

Adjust to equal and cancel out the padding total on the text headers.

Note: I have not tested this. If anyone tries it, please post with your results (and a link to see), and I will tweak if necessary.

8 Oct 2007, 7:35 PM
#15
miles avatar

miles

Zen Follower

Join Date:
Oct 2006
Location:
At Home
Posts:
357
Plugin Contributions:
0

Re: Hiding the sidebox heading fonts/links....

Doesn't work for me...

Here's what I did:

Step one,

In /includes/templates/my_template/common/tpl_box_default_left.php, change from this

// choose box images based on box position
  if ($title_link) {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
  }
//  
```to this

```php
//box header image if file exists  gjh42 2007-07-01
$title = (file_exists(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 

'boxhead-' . $box_id . '.gif') : $title);
if ($title_link) {
  if (file_exists(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif')) {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . '</a>';
  } else {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
  }
}
//  
```**Step two**,

Save image in here /my_template/images/boxhead-categories.gif

**Step three**,

In stylesheet, 

#manufacturerHeading {
background-image: url("../images/boxhead-categories.gif");
}

8 Oct 2007, 11:40 PM
#16
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Hiding the sidebox heading fonts/links....

miles:

Doesn't work for me...

Here's what I did:

Step one,

In /includes/templates/my_template/common/tpl_box_default_left.php, change from this

// choose box images based on box position
if ($title_link) {
$title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
}
//

> 
> ```php
//box header image if file exists  gjh42 2007-07-01
$title = (file_exists(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 

'boxhead-' . $box_id . '.gif') : $title);
if ($title_link) {
  if (file_exists(DIR_WS_TEMPLATE_IMAGES . 'boxhead-' . $box_id . '.gif')) {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . '</a>';
  } else {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
  }
}
//  
```**Step two**,
> 
> Save image in here /my_template/images/boxhead-categories.gif
> 
> **Step three**,
> 
> In stylesheet, 
> 
> ```
#manufacturerHeading {
   background-image: url("../images/boxhead-categories.gif");
}
```Is there something I missed? :unsure:


are you using your left sideboxes or is everything on the right?
If you are only using sideboxes on the right side you need to
edit includes/templates/my_template/common/tpl_box_default_right.php
instead of /tpl_box_default_left.php....or edit both if you are using sideboxes on both sides.....
9 Oct 2007, 2:20 AM
#17
miles avatar

miles

Zen Follower

Join Date:
Oct 2006
Location:
At Home
Posts:
357
Plugin Contributions:
0

Re: Hiding the sidebox heading fonts/links....

Thanks for the reply,

Actually I'm only using the left sidebox. So, I've made changes only to the tpl_box_default_left.php.

Do all the steps I'd made are the the right way to do?

9 Oct 2007, 2:54 AM
#18
gjh42 avatar

gjh42

Black Belt

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

Re: Hiding the sidebox heading fonts/links....

Three points:

  1. This method makes the image the "title", and it will be displayed without any addition to the stylesheet - you do not want to also make it the background.

  2. url("../images/boxhead-categories.gif");
    The quotes "" are not needed for this format; you can just use url(../images/boxhead-categories.gif);
    I don't know if the quotes will cause a problem.

  3. There is now a packaged copy of this mod in Downloads (Image Titles), modified to increase functions and be compatible with multiple languages. It requires no editing aside from uploading the files and image files to the correct locations.

9 Oct 2007, 3:47 AM
#19
miles avatar

miles

Zen Follower

Join Date:
Oct 2006
Location:
At Home
Posts:
357
Plugin Contributions:
0

Re: Hiding the sidebox heading fonts/links....

I just gave (Image Titles) mod a try, but it only changed the 'categories sidebox' header. What I need is to change the left 'manufacturer sidebox' header from text to image.

Can you help me on this? A step-by-step would be great...

Thanks for the help.

9 Oct 2007, 7:27 AM
#20
gjh42 avatar

gjh42

Black Belt

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

Re: Hiding the sidebox heading fonts/links....

When you uploaded the Image Titles files, did you overwrite the first custom copy of tpl_box_default_left.php? If not, you don't have a fully functioning version, which would explain only the categories swap if that was the only one you tried the first time.

If you did, there is nothing else you need to do beside load your boxhead-manufacturers.gif into /includes/templates/your_template/buttons/english/. You do need to be sure of the box name so that you name the gif properly.