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)
-   -   Need help, Interesting Slide show !! (https://forum.x-cart.com/showthread.php?t=43025)

Rajdeep 10-16-2008 03:13 AM

Need help, Interesting Slide show !!
 
Hi all,

I am attempting to setup slide show with some preselected products. When tested it is running fine on my local host.

When I am uploading it to X-cart in the home page (using e.g.: slide_show.tpl) a blank image box shows up where there is flickers but the actual images don't show up....

I have pasted the codes I tried below. Can someone suggest the error. It would be useful for lot many other users too.

Thanks in advance...

Codes:
-------------------------------------------------
<html>
<head>
<script type="text/javascript">
<!--
var image1=new Image()
image1. src="{$ImagesDir}/scroller images/offer-01.jpg"
var image2=new Image()
image2. src="{$ImagesDir}/scroller images/offer-02.jpg"
var image3=new Image()
image3. src="{$ImagesDir}/scroller images/offer-03.jpg"
//-->
</script>
</head>
<body>
<img src="{$ImagesDir}/scroller images/100048.jpg" name="slide" border="0" width="115" height="56" />
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src" )
if (step<3)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",2500)
}
slideit()
//-->
</script>
</body>
</html>
---------------------------------------

Balinor, may I request you for help please...

balinor 10-16-2008 03:17 AM

Re: Need help, Interesting Slide show !!
 
You need to surround the javascript with {literal} tags:

{literal}Javascript here {/literal}

Rajdeep 10-16-2008 06:19 AM

Re: Need help, Interesting Slide show !!
 
Thanks Balinor for your prompt response as always...

Unfortunately the codes are still not working (reason of my delayed response). Was trying with some variations here & there...

Is there any other error in the codes below which I might have overlooked? Your inputs would be of immense help.

Thank you once again,

Regards,

balinor 10-16-2008 06:22 AM

Re: Need help, Interesting Slide show !!
 
Well you can't use Smarty in there, so instead of {$ImagesDir} use skin1/images/

Rajdeep 10-16-2008 07:38 AM

Re: Need help, Interesting Slide show !!
 
Balinor thanks again !

Weird it still shows no result in home page (customer/home.tpl) where I called this file just below the help.tpl

The file slide_show.tpl has these set of codes based on your inputs
-------------
<html>
<head>
{literal}
<script type="text/javascript">
<!--
var image1=new Image()
image1. src="skin1/images/scroller images/offer-01.jpg"
var image2=new Image()
image2. src="skin1/images/scroller images/offer-02.jpg"
var image3=new Image()
image3. src="skin1/mages/scroller images/offer-03.jpg"
//-->
</script>
{/literal}
</head>
<body>
<img src="skin1/images/scroller images/100048.jpg" name="slide" border="0" width="115" height="56" />
{literal}
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src" )
if (step<3)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",2500)
}
slideit()
//-->
</script>
{/literal}
</body>
</html>

-------------

I am stuck there BOSS....

balinor 10-16-2008 07:40 AM

Re: Need help, Interesting Slide show !!
 
Are you trying to just put that code in? Because it doesn't work that way - you need to add the script in the head to the actual head of the site, which is in customer/home.tpl. Then you need to add the second part where you want it to show in the templates. Follow me? You don't add body, head, or html tags - those can only be in one place - customer/home.tpl

Rajdeep 10-16-2008 07:50 AM

Re: Need help, Interesting Slide show !!
 
Sorry Balinor if I sound dumb, though I understand what you mean but if I am not troubling you too much cud you let me know which part of the codes mentioned below I add in the home.tpl file & what of the balance codes I put in the said slide_show.tpl which has been called below help.tpl in the customer/home.tpl....

Please help me out of this silly thing....

balinor 10-16-2008 07:52 AM

Re: Need help, Interesting Slide show !!
 
Ok, open up customer/home.tpl and place this right before the </head> tag:

{literal}
<script type="text/javascript">
<!--
var image1=new Image()
image1. src="skin1/images/scroller images/offer-01.jpg"
var image2=new Image()
image2. src="skin1/images/scroller images/offer-02.jpg"
var image3=new Image()
image3. src="skin1/mages/scroller images/offer-03.jpg"
//-->
</script>
{/literal}

then put this part wherever you want the slideshow to appear:

<img src="skin1/images/scroller images/100048.jpg" name="slide" border="0" width="115" height="56" />
{literal}
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src" )
if (step<3)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",2500)
}
slideit()
//-->
</script>
{/literal}

Usually that would go on customer/main/welcome.tpl if you wanted it to appear on the home page.

Rajdeep 10-16-2008 07:58 AM

Re: Need help, Interesting Slide show !!
 
Thanks Boss,

while I try the way suggested by you, let me specify what we are doing currently with welcome.tpl

We are using the welcome.tpl for a Offer announcement with an 360 px by 145 px rectangle with 4 product images inside; each linking to an offer. We wanted to use the empty space below help.tpl (in our home page) to display additional offers in a flash like app.

So what do I do .....

balinor 10-16-2008 07:59 AM

Re: Need help, Interesting Slide show !!
 
Then put the second bit of code wherever help.tpl is - probably customer/home.tpl

Rajdeep 10-16-2008 08:13 AM

Re: Need help, Interesting Slide show !!
 
Sorry Balinor,

It still doesn't work ......

Put 1st part of the codes before </head> & balance codes just below the help.tpl...

results are nil...

balinor 10-16-2008 09:29 AM

Re: Need help, Interesting Slide show !!
 
You are missing an 'i' in images:

skin1/mages/scroller images/offer-03.jpg

Rajdeep 10-17-2008 02:01 AM

Re: Need help, Interesting Slide show !!
 
Dude me....

Now it is working like charm....

Thanks for all the support & inputs Balinor....


All times are GMT -8. The time now is 02:00 AM.

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