View Full Version : small help to add image from xml to gAjax RSS Pausing Scroller please..

05-06-2011, 01:25 PM
Hi and thanks from France..

1) Script Title: gAjax RSS Pausing Scroller

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex18/gajaxpausescroller.htm

3) Describe problem:

I have xml with products, i have test this script and working juste need to add images of products from xml
<url>image source</url>
<link>link product</link>

if you have small or big idea.. Merci !

05-06-2011, 04:40 PM
The script is powered by Google Feeds API (http://code.google.com/apis/feed/v1/devguide.html), which according to my understanding doesn't support indexing of user specified elements such as <url> for example. In order to display images in your feeds then, you'd have to include them within each RSS entry's <description> element using regular IMG tags.

05-07-2011, 07:25 AM

thaks for your answer..

if i not think have understand what you mean..

i have actualy in my xml :
<url>image source</url>
<link>link product</link>

you mean i add in my xml ?
<url>image source</url>
<link>link product</link>

or adding it in gajascroller.jsp ?

// -------------------------------------------------------------------
// formatrssmessage()- Global function that formats a RSS entry(s) to the desired components (title, date, description etc)
// -------------------------------------------------------------------

function formatrssmessage(feedslice, showoptions, itemcontainer, linktarget){
var rssoutput=(itemcontainer=="<li>")? "<ul>\n" : "" //if "itemcontainer" is set to "<li>", define a "<ul>" tag to wrap around the result
for (var i=0; i<feedslice.length; i++){ //Loop through the entered slice of a RSS feed (1 or more entries)
var itemtitle="<a href=\"" + feedslice[i].link + "\" target=\"_blank\" class=\"titlefield\">" + feedslice[i].title + "</a>"
var itemlabel=/label/i.test(showoptions)? '<span class="labelfield">['+feedslice[i].ddlabel+']</span>' : " "
var itemdate=gfeedfetcher._formatdate(feedslice[i].publishedDate, showoptions)
var itemdescription=/description/i.test(showoptions)? "<br />"+feedslice[i].content : /snippet/i.test(showoptions)? "<br />"+feedslice[i].contentSnippet : ""
rssoutput+=itemcontainer + itemtitle + " " + itemlabel + " " + itemdate + "\n" + itemdescription + itemcontainer.replace("<", "</") + "\n\n"
rssoutput+=(itemcontainer=="<li>")? "</ul>\n" : ""
return rssoutput

i have test this, it will add loading image :

var itemtitle="<a href=\"" + feedslice[i].link + "\" target=\"_blank\" class=\"titlefield\"><img src=\""+gfeedfetcher_loading_image+"\" border=\"0\" align=\"absmiddle\" /> " + feedslice[i].title + "</a>"

it is at this place where we place image <description> ?

or adding in my xml something like this : <description><![CDATA[ to have facility to adding it in script..

see in this link what working (in bottom of page ) : http://www.reparateur-pc-portable.fr


05-13-2011, 07:07 AM

juste a small way to help me please..


05-13-2011, 10:46 PM
If you wish to display images within the description (body) of each RSS entry, you might try just including IMG tags inside the <description> tags, such as:

<description>[CDATA[<img src="http://mysite.com/test.gif" />Sticky Note lets you displays floating content anywhere on the page that remains in view even when the page is scrolled. Each sticky note content can be defined either inline on the page, or inside an external text file and fetched via Ajax instead.]]</description>

Now, I haven't tested whether this actually works, as there doesn't seem to be any clear standards on whether HTML tags are allowed inside RSS feeds, and even if they are, there is no mention of support for them on Google's RSS Feeds documentation (http://code.google.com/apis/feed/v1/devguide.html).

05-14-2011, 07:09 AM
Hi and thanks again..

i know that for your last code..

but my probleme is in js code, how to extract that

to showing image via js, we can only extract title..

you know what i meen ?

thanks for your help again..

05-15-2011, 07:50 PM
Wait, where is the IMG tag embedded inside your RSS entry, the TITLE or DESCRIPTION element?

05-19-2011, 03:30 PM
Hi and thanks..

i'm not sure have undestand what you mean and may the same for you..

here a part code of my xml:

<?xml version="1.0" encoding="UTF-8" ?>

<rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0">

<title>My title</title>
<description>desctiption title</description>

<title>product title</title>
<description>product description</description>
<!--or we ca add image in description like :
<description>[CDATA[<img src="http://image url">]]</description>
<link>http://product link</link>
<title>product image title</title>
<url>http://image url</url>
<link>http://product link</link>

need to add image of product

05-24-2011, 06:55 AM
Hi, just a small up..

06-03-2011, 07:38 AM

any idea please ?