Results 1 to 10 of 10

Thread: small help to add image from xml to gAjax RSS Pausing Scroller please..

  1. #1
    Join Date
    May 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb small help to add image from xml to gAjax RSS Pausing Scroller please..

    Hi and thanks from France..

    1) Script Title: gAjax RSS Pausing Scroller

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...sescroller.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
    <image>
    <title>name</title>
    <url>image source</url>
    <link>link product</link>

    if you have small or big idea.. Merci !

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The script is powered by Google Feeds API, 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.
    DD Admin

  3. #3
    Join Date
    May 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb

    Bonjour,

    thaks for your answer..

    if i not think have understand what you mean..

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

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

    or adding it in gajascroller.jsp ?
    Code:
    // -------------------------------------------------------------------
    // 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 :
    Code:
    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

    thanks
    Last edited by repare; 05-07-2011 at 08:01 AM.

  4. #4
    Join Date
    May 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    juste a small way to help me please..

    thank's

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    <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.
    DD Admin

  6. #6
    Join Date
    May 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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..

  7. #7
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Wait, where is the IMG tag embedded inside your RSS entry, the TITLE or DESCRIPTION element?
    DD Admin

  8. #8
    Join Date
    May 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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:

    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    
    <rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0">
    
    
    <channel>
    <title>My title</title>
    <description>desctiption title</description>
    <link>http://mysite</link>
    
    <item>
    <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>
    <image>
    <title>product image title</title>
    <url>http://image url</url>
    <link>http://product link</link>
    </image>
    </item>
    ....
    need to add image of product

  9. #9
    Join Date
    May 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi, just a small up..

  10. #10
    Join Date
    May 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    any idea please ?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •