X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Upload img (https://forum.x-cart.com/showthread.php?t=47967)

swifty1 06-07-2009 03:02 AM

Upload img
 
I have uploaded an image to skin1/images, put the following code on a static page
<td width=20% align=center> <img src="{$/ImagesDir}/people1.jpg" alt="Customer reviews" /></td>
The image does not show, only the alt text is visable where the image should be.
The image is in the file as i have checked with FTP.
Where am i going wrong?

gb2world 06-07-2009 10:49 AM

Re: Upload img
 
You have an inadvertent backslash:
change {$/ImagesDir} to {$ImagesDir}

swifty1 06-07-2009 11:18 AM

Re: Upload img
 
Hi I have removed the inadvertent backlash but image still not showing.

gb2world 06-07-2009 11:57 AM

Re: Upload img
 
Have you tried running cleanup.php?

When you view the html source - is the path to the image as you expect it to be? You should see the correct path in your html source: <img src="/skin1/images/people1.jpg" alt="Customer reviews" />

swifty1 06-07-2009 01:37 PM

Re: Upload img
 
As to running cleanup.php, no i have not.
I am not sure how i see the correct html source?

gb2world 06-07-2009 01:43 PM

Re: Upload img
 
To view the html, look in the browser's menu, for something like View->Page Source or Page->View Source

swifty1 06-07-2009 01:50 PM

Re: Upload img
 
This is what i see
<td width=20% align=center<img src="{$ImagesDir}/people1.jpg" alt="Customer reviews" /></td>
Which is not what you thought....any ideas as to why the correct path is not showing?

gb2world 06-07-2009 02:01 PM

Re: Upload img
 
There is a setting somewhere to parse smarty on static pages - let me look for it....

gb2world 06-07-2009 02:04 PM

Re: Upload img
 
General Settings -> Miscellaneous -> Parse Smarty tags in the content of embedded static pages:

Select this check box if
you want your static pages to be treated as templates.

swifty1 06-07-2009 02:08 PM

Re: Upload img
 
This box is unchecked are you saying that the box should be checked, if so what does this do and will it affect my store in other ways?

gb2world 06-07-2009 02:17 PM

Re: Upload img
 
If you want to put smarty tags in your static pages - then they need to be parsed and compiled - so you would need to check the box.

It should not affect the rest of your store. The difference will be that it will take some added amount of time & resources to compile your static pages for the smarty. The added time is likely not significant.

If you prefer not to have that done - you can use the absolute link to the image in your static page, and avoid using smarty

swifty1 06-07-2009 02:36 PM

Re: Upload img
 
Thanks for the solution gb2world, i had re-aplied the absolute link to the static page, the reason why i tried smarty is the help guide http://forum.x-cart.com/showthread.php?t=21529 which states a security issue so i thought i would give it a try.
I will try out your sugestion, thanks again gb2world....

gb2world 06-07-2009 02:50 PM

Re: Upload img
 
It is not really a security issue - but the problem is you may get security warnings on some browsers if you use absolute paths to the images - which will scare off customers.

So - if you used an "http://" in the absolute link to the image - and if your cart is set up so that the static page can be accessed with an "https://" - you will get a security warning. I think if you set up the absolute link with "/skin1/images/people1.jpg" on your static pages, you'll probably be okay.

swifty1 06-07-2009 02:51 PM

Re: Upload img
 
Thanks gb2world, it worked.


All times are GMT -8. The time now is 08:20 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.