View Full Version : Article Images in SAG Content Scroller

10-04-2010, 10:44 PM
1) Script Title: SAG Content Scroller

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex2/sagscroller.htm

3) Describe problem:

First wanted to thank you for this fantastic script.
I am using this script without being able to present images of the news, i want samething like the display news of yahoo rss used in the demo.
Is there any way to adapt the script without having to change the rss of my site?

My ticker:

The rss for my site:

The yahoo rss that works well with the script:

Thanks in advance for your help

10-05-2010, 01:25 AM
Hmm as far as I'm know the only way to show images is to include the image(s) inside the DESCRIPTION element of each entry. That's the syntax required by Google Feeds API, which upon retrieving your RSS feeds returns that information in the structure described here (http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON). As you can see, only a predetermined set of elements are returned, such as author, entries[x], entries[x].content etc. It doesn't let you return the contents of a custom element within entries[x], in your case, entries[x].image. This means unfortunately you'll need to modify the structure of your RSS feed so the images are embedded inside the DESCRIPTION element.

10-05-2010, 10:43 AM
:) Thanks for your help!
i will try now to change the rss structure.

keep on the good work.

10-27-2010, 09:51 PM
Hi DD Admin,
its working fine, the images are displaying and im working now to insert a select list of diferent rss, can you help me to translate the rss displayoptions: 'datetime label description', to Portuguese? sorry im new in js, please help.
You can see here what im doing (if you have a better way, advise me):

Thanks in advance.

11-29-2010, 04:58 PM
Hi DD,
the images links are not openning in a new page like the news title tag:

+(/description/.test(rssdata.displayoptions) ? entries[i].content : entries[i].contentSnippet)

Can you help me to do it please?

Thanks in advance.

11-30-2010, 05:53 AM
This is untested but should work. Inside the .js file, try finding the below line:

+(/description/.test(rssdata.displayoptions)? entries[i].content : entries[i].contentSnippet)

and replace it with:

+(/description/.test(rssdata.displayoptions)? entries[i].content.replace(/href="([^"]+)/g, "href=\"$1\" target=\"_new") : entries[i].contentSnippet)

12-01-2010, 04:18 PM
Thanks for your help, its working fine.