Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Rotate news items in vertical right menu

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-11-2009, 05:01 PM
 
ladybird ladybird is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 93
 

Unhappy 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
__________________
x-cart gold 4.1.9
x-cart gold 4.1.5
www.makeuwell.com.au
www.amberbebe.com
Sydney Australia
Reply With Quote
  #2  
Old 01-12-2009, 09:07 PM
 
Kannan Kannan is offline
 

Senior Member
  
Join Date: Apr 2008
Posts: 116
 

Default 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
__________________
4.6.6
- SNK
Reply With Quote
  #3  
Old 01-15-2009, 05:18 PM
 
ladybird ladybird is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 93
 

Default Re: Rotate news items in vertical right menu

Rotating News Items - any help?
__________________
x-cart gold 4.1.9
x-cart gold 4.1.5
www.makeuwell.com.au
www.amberbebe.com
Sydney Australia
Reply With Quote
  #4  
Old 01-15-2009, 05:23 PM
 
ladybird ladybird is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 93
 

Default 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?
__________________
x-cart gold 4.1.9
x-cart gold 4.1.5
www.makeuwell.com.au
www.amberbebe.com
Sydney Australia
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:56 PM.

   

 
X-Cart forums © 2001-2020