Zen Cart Logo
Forums / General Questions / Question about file/ directory paths

Question about file/ directory paths

Locked

Views: 1,021

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
2 Sep 2008, 1:59 AM
#1
chillout_buddha avatar

chillout_buddha

New Zenner

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

Question about file/ directory paths

zen_image(DIR_WS_TEMPLATES.'template_default/'.DIR_WS_IMAGES.'icons/error.gif')

In the above code, is there a way to write it so that I can avoid hard-coding "template_default/"? If I move error.gif file in my override folder, I will have to change the above code and replace "template_default/" with my override directory. Is there a way to make the code more generalised?

2 Sep 2008, 2:04 AM
#2
kobra avatar

kobra

Black Belt

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

Re: Question about file/ directory paths

Don't know from where this code was extracted???

But if stock code - then leave it alone as the override system will sort it out

2 Sep 2008, 2:05 AM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: Question about file/ directory paths

If it's not stock code, try

zen_image(DIR_WS_TEMPLATE_IMAGES.'icons/error.gif')

This will resolve to the current active template's /images/ folder. If the image is not found there, it will look in the same place in /template_default/.

2 Sep 2008, 2:16 AM
#4
chillout_buddha avatar

chillout_buddha

New Zenner

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

Re: Question about file/ directory paths

gjh42:

If it's not stock code, try

zen_image(DIR_WS_TEMPLATE_IMAGES.'icons/error.gif')

This will resolve to the current active template's /images/ folder. If the image is not found there, it will look in the same place in /template_default/.

Thanks, that worked!