Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Replacing HEADING_TITLE with Images

Replacing HEADING_TITLE with Images

Locked

Views: 2,945

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
10 Sep 2006, 1:25 AM
#1
radish avatar

radish

New Zenner

Join Date:
Jan 2006
Posts:
67
Plugin Contributions:
0

Replacing HEADING_TITLE with Images

Hi,

I grabbed the 'About Us Page' contribution to make several new pages and everything is going well, but I want to replace the headings of the page with images from our current static site.

I took a look at several of the pages included to create the about page and decided to make changes in the 'tpl_about_us_default.php'.

I've commented out this line:

<h1 id="aboutUsHeading"><?php echo HEADING_TITLE; ?></h1>

and replaced it with this:

<div id="bagsection"><img src="/images/tag_about.gif" alt="Radish Clutches" width="162" height="40"></div>

I realize that I could use some CSS and insert a background image, but that would require putting some <span> tags around the <h1> tags to hide the text. I figured my way was faster.

My concern is that the method I've chosen isn't the cleanest way of going about things. Does anyone know if I'm creating a headache for myself once the next version of ZenCart rolls out? (I'm currently running 1.3.5)

Many thanks!

Colin

10 Sep 2006, 1:37 AM
#2
kim avatar

kim

Obaa-san

Join Date:
Jun 2003
Posts:
26,594
Plugin Contributions:
0

Re: Replacing HEADING_TITLE with Images

You are creating a headache.

Define the constant HEADING_TITLE as the image in the Language file for the page.

10 Sep 2006, 1:47 AM
#3
radish avatar

radish

New Zenner

Join Date:
Jan 2006
Posts:
67
Plugin Contributions:
0

Re: Replacing HEADING_TITLE with Images

Thanks Kim!

Originally I was going to make changes there, but I played rock-paper-scissors with myself and lost.

10 Sep 2006, 2:00 AM
#4
radish avatar

radish

New Zenner

Join Date:
Jan 2006
Posts:
67
Plugin Contributions:
0

Re: Replacing HEADING_TITLE with Images

Hi Kim,

Sorry about the multiple questions for such a basic solution, but I'm trying to avoid any hassle in the future.

Should I be making changes in the same place - the language files - for 'native' ZC pages (i.e. the contact us page)?

Cheers,

Colin

10 Sep 2006, 2:58 AM
#5
radish avatar

radish

New Zenner

Join Date:
Jan 2006
Posts:
67
Plugin Contributions:
0

Re: Replacing HEADING_TITLE with Images

Hi,

Sorry about these continuing posts. I've been able to set header images for pages created with the 'About Us' contrib quite easily with Kim's heads up. I've also managed to insert the 'Contact Us' page in the contact_us define file (though they're not perfectly aligned to About Us and Locations pages)

However, I'm running into a block when trying to create header images for individual categories.

It's probably easier to see what I'm talking about here:

http://www.radish.ca/index.php?main_page=index&cPath=5

I would like to replace the text 'Collections' with an image. Further to that, I'd like to replace sub-categories like 'Fall Collection - 2006' with an image as well. Since these titles are all coming from a database, is this easily doable? Or would I have to go into the DB and insert the image path?

Thanks again!

Colin

10 Sep 2006, 6:03 AM
#6
kim avatar

kim

Obaa-san

Join Date:
Jun 2003
Posts:
26,594
Plugin Contributions:
0

Re: Replacing HEADING_TITLE with Images

Since these titles are all coming from a database, is this easily doable? Or would I have to go into the DB and insert the image path?

Sorry- not so easy. The categories menu is dynamically generated.

10 Sep 2006, 7:50 AM
#7
radish avatar

radish

New Zenner

Join Date:
Jan 2006
Posts:
67
Plugin Contributions:
0

Re: Replacing HEADING_TITLE with Images

Hi Kim,

I actually found a solution to what I was looking for and lo and behold it was already built into ZenCart! It only took some Heineken and half a box of rosebuds to figure this out.

ZenCart never ceases to amaze!!!

For anyone else wanting to replace category text headings with images take a look at the read_me file in your_template/css.

To save you some reading, basically you create seperate stylesheets for each category id. For example the stylesheet for:

http://www.yoursite.com/index.php?main_page=index&cPath=5_2

would be c_5_2.css. The '5' is the main category and the '2' is the sub-category. If you get confused, just look at the url.

You only need to include the div or class you're looking to alter.

To replace the category heading text with an image your stylesheet would like this:

#indexCategoriesHeading {
text-indent: -220px;
overflow: hidden;
background: url(/images/text_replacer.gif) no-repeat;
height: 34px;
width: 345px;
}

If you a have a couple layers of sub-categories you'll need to change this id - #productListHeading - to achieve the same results.

Hope this helps!

2 Dec 2006, 9:26 AM
#8
tbrides avatar

tbrides

Zen Follower

Join Date:
Oct 2006
Posts:
198
Plugin Contributions:
0

Re: Replacing HEADING_TITLE with Images

hi radish,
i really like your design. it is cool. im trying to achieve something similar but im only new to zen cart.

can you give me some tips on how u achieved your design.

you can see that start of my work here

http://www.hartonpaw.com/store
kindest regards

15 Feb 2009, 11:30 AM
#9
jenred avatar

jenred

New Zenner

Join Date:
Jul 2004
Location:
Australia
Posts:
48
Plugin Contributions:
0

Re: Replacing HEADING_TITLE with Images

Define the constant HEADING_TITLE as the image in the Language file for the page.

Can you please explain your instruction above for me?

I want to have an title image for each of these pages: New, Featured, Specials. I tried going into:

/includes/languages/english/specials.php
/includes/languages/english/products_new.php
/includes/languages/english/products_all.php

and changed this:

define('HEADING_TITLE', 'new products');

to this:

define('HEADING_TITLE', 'my_new_image.gif');

but all that did was print those words "my_new_image.gif" as the new heading title for that page. Not sure what else to try... :)

thanks!