View Full Version : Article Images in SAG Content Scroller
omestre
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:
http://www.impresapublishing.pt/rss/ticker/index_om.html
The rss for my site:
http://aeiou.expresso.pt/manchetes_feed.rss
The yahoo rss that works well with the script:
http://rss.news.yahoo.com/rss/topstories
Thanks in advance for your help
ddadmin
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.
omestre
10-05-2010, 10:43 AM
:) Thanks for your help!
i will try now to change the rss structure.
keep on the good work.
omestre
10-27-2010, 09:51 PM
Hi DD Admin,
it´s working fine, the images are displaying and i´m 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 i´m new in js, please help.
You can see here what i´m doing (if you have a better way, advise me):
http://aplicacoes.expresso.pt/inqueritos/tickers/teste_select.html
Thanks in advance.
omestre
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.
ddadmin
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)
omestre
12-01-2010, 04:18 PM
Thanks for your help, it´s working fine.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.