Zen Cart Logo

Template overrides?

Views: 844

Results 1 to 10 of 10
8 Feb 2012, 2:16 PM
#1
rwslippey avatar

rwslippey

New Zenner

Join Date:
Jan 2010
Posts:
70
Plugin Contributions:
0

Template overrides?

I've been working with Zen Cart for a while now and I just got home from, well we'll just say a long trip for employment. So I'm getting back into Zen Cart after about a year of hit or miss internet access and I installed the latest version... everything went great (very happy to see the added security compliance stuff but I'll have to read into it further)

So I decided to use this new version, and some extra time I now have, to create a whole new template...

I created my new template folder in /includes/templates/
including the template_info.php file...

Changed my logo and put it in /includes/templates/CUSTOM/images folder however when I look at the source of my page it's still got the old templates directory used for the logo src...

<img src="includes/templates/template_default/images/logo.gif" 

So it would seem to me that the get template function (I guess it's a function) is not functioning properly... or perhaps I have missed something in the last 10 or so months that I've been away, or I'm just a complete idiot and forgot something along the way... :oops:

anybody had this issue?
or have any ideas?

8 Feb 2012, 3:48 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Template overrides?

Did you select the CUSTOM template in Admin - Tools - Template Selection ?

9 Feb 2012, 2:34 PM
#3
rwslippey avatar

rwslippey

New Zenner

Join Date:
Jan 2010
Posts:
70
Plugin Contributions:
0

Re: Template overrides?

sorry,

Yes I did select it in admin. Everything template wise seems to be working fine except the logo is still calling /template_default instead of my custom template directory..

I put a temporary fix in and got the logo to appear...

9 Feb 2012, 3:05 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Template overrides?

Can you provide a link to the site ?

9 Feb 2012, 3:08 PM
#5
rwslippey avatar

rwslippey

New Zenner

Join Date:
Jan 2010
Posts:
70
Plugin Contributions:
0

Re: Template overrides?

Not as of yet, site is on a dev server offline...

9 Feb 2012, 3:14 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Template overrides?

What filename did you use for your new logo? If it is other than logo.gif, you will have to change a language file to refer to the new one, as well as edit the dimensions.

9 Feb 2012, 3:37 PM
#7
rwslippey avatar

rwslippey

New Zenner

Join Date:
Jan 2010
Posts:
70
Plugin Contributions:
0

Re: Template overrides?

The logo was actually a jpeg...

I did change the file name...

the issue was that it wasn't looking in the correct folder..

After making the new template and switching it in admin it was still attempting to find the image in /template_default/images.... in place of where the image should have been /CUSTOM/images....

for now I simly modified tpl_header.php from

<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>

to...

<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . '<img src="' . HTTP_SERVER . DIR_WS_CATALOG . 'includes/templates/wepaythetaxes/images/'.  HEADER_LOGO_IMAGE . '" alt="', HEADER_ALT_TEXT . '" /></a>'; ?></div>

I think the problem might lay with

($template->get_template_dir

It was looking for the right file, just in the wrong place...

/template_default/images instead of my custom template /CUSTOM/images and I wanted the template to be exportable so I didn't want to just throw it in the template_default folder which would have worked just as well..

thanks for the help and tips everyone

9 Feb 2012, 4:44 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Template overrides?

The stock code WILL look in your custom template first. If it doesn't find what it is looking for there, then it looks in /template_default/. (That's why you see the link in view source with the default location.)
So you should figure out what mismatch you had that was making it look for something different than what you had in your template folder.

9 Feb 2012, 6:08 PM
#9
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Template overrides?

If you changed the logo to a .jpg, did you remember to edit the header.php file to reflect that?

includes/languages/english/your_template/header.php

define('HEADER_LOGO_IMAGE', 'logo.gif ');

9 Feb 2012, 6:32 PM
#10
rwslippey avatar

rwslippey

New Zenner

Join Date:
Jan 2010
Posts:
70
Plugin Contributions:
0

Re: Template overrides?

Ok I think I understand where I messed up... the last comments are correct... I didn't change the extension... so it never found the logo.jpg in my /Custom/images template directory.. so then it just grabbed what it could find... /template_default/images/logo.gif

Thanks for all the replies... I was stuck on the wrong directory not the wrong file name...:oops: