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)
-   -   Rotate news items in vertical right menu (https://forum.x-cart.com/showthread.php?t=44737)

ladybird 01-11-2009 05:01 PM

Rotate news items in vertical right menu
 
Hi Everyone,

I am trying to figure out how to get the news items which appear in the vertical right menu of x-cart to rotate.

I have searched the form and found a couple possible starting points, and I have searched the web looking at banner rotators. Before I start messing with the templates which is my next course of action I thought I would ask

1) has anyone successfully done what I am trying to do
2) if you have would you be able to share the process steps for doing it.

My intention is to have a short paragraph rotate every 5 - 10 seconds or so which highlights a different news story.

I found this rotating array script:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Rotating Quotes</title>

<style type="text/css">
/*<![CDATA[*/

body {
background-color:#aaaaaa;
}
#quotes {
position:absolute;
left:50%;
top:50%;
margin:-50px 0 0 -81px;
padding:20px;
font-family:arial;
font-size:16px;
color:#000000;
width:162px;
height:100px;
border:solid 1px #000000;
background-color:#ffffff;
text-align:center;
}

/*//]]>*/
</style>

<script type="text/javascript">
//<![CDATA[
var quote=new Array();
quote[0]='This is quote number one'; /* add as many quotes as you like!*/
quote[1]='This is quote number two';
quote[2]='This is quote number three';
quote[3]='This is quote number four';
quote[4]='This is quote number five';
quote[5]='This is quote number six';
quote[6]='This is quote number seven';
quote[7]='This is quote number eight';
quote[8]='This is quote number nine';
quote[9]='This is quote number ten';


var speed=2000; /*this is the time in milliseconds adjust to suit*/
var q=0;

function showQuote() {

document.getElementById("quotes").innerHTML=quote[q];
q++;
if(q==quote.length) {
q=0;
}
}
setInterval('showQuote()',speed);

//]]>
</script>

</head>
<body>

<div id="quotes"></div>

</body>
</html>

but is there a way to have the section in green simply select and read the last say 5 news items from the archive?

L

Kannan 01-12-2009 09:07 PM

Re: Rotate news items in vertical right menu
 
hi,

how do you pass the dynamic elements to javascript array variable. could you post the code, which you implemented in x-cart site. because i already tried to implement same case to implement to tabbing content. it is like as rotating banner.

thanks
kannan

ladybird 01-15-2009 05:18 PM

Re: Rotate news items in vertical right menu
 
Rotating News Items - any help?

ladybird 01-15-2009 05:23 PM

Re: Rotate news items in vertical right menu
 
I reckon I could have a crack at creating a new news.tpl file that contains the above rotating array, and referencing the publishing news items. The bit I am not sure about is how to limit it to say just the latest 5 items dynamically. any thoughts for how to do this?


All times are GMT -8. The time now is 06:13 PM.

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