Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Change Featured Products header to an image

Change Featured Products header to an image

Locked

Views: 3,753

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
1 Nov 2008, 1:23 AM
#1
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Change Featured Products header to an image

Hi,

I've seen it before somewhere in the forum I think?

I want to change the "new products for" header and "featured products" header on the home page to an image.

http://www.lyonslimited.com/catalog/

1 Nov 2008, 1:34 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Change Featured Products header to an image

Depending upon the image, a tile or a full size image - add to the following in your stylesheet

.centerBoxHeading {
	margin: 0em;
	background-color: #630000;
	padding: 0.5em 0.2em;
	}

Some or all of the following and adjust for your image name & type

background-image: url(../images/center_bg.jpg);
background-repeat: no-repeat;
1 Nov 2008, 1:41 AM
#3
pelasgos avatar

pelasgos

New Zenner

Join Date:
Dec 2006
Location:
Athens - Greece
Posts:
71
Plugin Contributions:
0

Re: Change Featured Products header to an image

One way (I don't know if that's the best way to do it) is to edit your stylesheet.css and set featured to have an image as background. Of course you'll have to edit english.php to remove the "Featured Products..." text.
The same for New Products.

Hope that it helps

George

1 Nov 2008, 1:53 AM
#4
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: Change Featured Products header to an image

Thanks Kobra,

I cannot text-align: center; in my stylesheet.

Nor can I make custom headers for "new products" and "featured products"

Working locally on my machine---

I have this in the stylesheet:

.centerBoxHeading {
margin: 0em;
background-image: url(../images/featured-bg-head.jpg);
background-repeat: no-repeat;
padding: 0.5em 0.2em;
line-height: 48px;
text-align: center;
}

1 Nov 2008, 2:13 AM
#5
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,604
Plugin Contributions:
0

Re: Change Featured Products header to an image

Bob -

You need to use the ID for each box to differentiate between them.

#whatsNew .centerBoxHeading {}

2 Nov 2008, 1:09 AM
#6
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: Change Featured Products header to an image

Thanks Kim,

Starting to work. But I still cannot center the image

#featuredProducts .centerBoxHeading {
margin: 0em;
background-image: url(../images/featured-bg-head.jpg);
background-repeat: no-repeat;
background-color: #FFFFCC;
padding: 0em;
line-height: 48px;
text-align: center;
height: 1%; /* IE6 bug issue */
}

The text-align: center is not working. Suggestions?

2 Nov 2008, 1:12 AM
#7
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: Change Featured Products header to an image

see attached screen shot...working locally but if you want I can post changes to the web site

2 Nov 2008, 1:16 AM
#8
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,604
Plugin Contributions:
0

Re: Change Featured Products header to an image

Try background-position instead of text-align.

2 Nov 2008, 1:35 AM
#9
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: Change Featured Products header to an image

Thank you Kim,

This works well.

2 Nov 2008, 2:52 AM
#10
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: Change Featured Products header to an image

Well now this presents another problem.

http://www.lyonslimited.com/catalog/index.php?main_page=index&cPath=2

The architecture still shows up in white letters on the header image

2 Nov 2008, 3:00 AM
#11
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,604
Plugin Contributions:
0

Re: Change Featured Products header to an image

Remove it from your english.php

2 Nov 2008, 3:12 AM
#12
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: Change Featured Products header to an image

I am unable to identify where to remove this in the english.php

Help?

2 Nov 2008, 8:05 AM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Change Featured Products header to an image

You are using the Image Titles mod, and for some reason the code is not removing the category name appended to the title when the image is being used, even though it is written to do that.

Is your /includes/modules/your_template/featured_products.php showing this code at the bottom of the file?```php
if (isset($new_products_category_id) && $new_products_category_id !=0) {
$category_title = zen_get_categories_name((int)$new_products_category_id); //image titles - box header image if file exists 2007-10-04
$title = '<h2 class="centerBoxHeading">' . (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-featured.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-featured.gif') : TABLE_HEADING_FEATURED_PRODUCTS . ($category_title != '' ? ' - ' . $category_title : '')) . '</h2>';
} else {
$title = '<h2 class="centerBoxHeading">' . (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-featured.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/centerboxhead-featured.gif') : TABLE_HEADING_FEATURED_PRODUCTS) . '</h2>';
}

2 Nov 2008, 8:19 AM
#14
gjh42 avatar

gjh42

Black Belt

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

Re: Change Featured Products header to an image

Hmm... are you applying the Image Titles mod to the centerboxes, or trying to do those manually? If you have renamed the mod's /includes/modules/your_template/ folder to your custom template name, all you have to do is save the image as
/includes/templates/your_template/buttons/english/centerboxhead-featured.gif.

2 Nov 2008, 8:32 AM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: Change Featured Products header to an image

I see the problem. You are using the old version of Image Titles, before the switch to language-specific images, and that version may not have had centerbox title support.```html

<h3 class="leftBoxHeading" id="searchHeading"><img src="includes/templates/custom_template/images/boxhead-search.gif" alt="" width="150" height="38" /></h3> ```

You should install the current version of Image Titles and move the images to the corresponding /buttons/english/ folder.