gAjax RSS Feeds Displayer v2.0 with read more link
1) Script Title: gAjax RSS Feeds Displayer v2.0
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...sdisplayer.htm
3) Describe problem: i want to add a "read more" link at the end of the description.
With additional code i already made it work that it shows a certain amount of words from the description, so it makes sense to put a read more link there ;)
I tried putting the "read more link" in the function gfeedfetcher(divid, divClass, linktarget). However I don't know how to put the url there as i get confused with all the " ' etc.
Or maybe there is a better solution? I am not so familiar using javascript.
thank you :)
Code:
function gfeedfetcher(divid, divClass, linktarget){
this.linktarget=linktarget || "" //link target of RSS entries
this.feedlabels=[] //array holding lables for each RSS feed
this.feedurls=[]
this.feeds=[] //array holding combined RSS feeds' entries from Feed API (result.feed.entries)
this.feedsfetched=0 //number of feeds fetched
this.feedlimit=5
this.showoptions="" //Optional components of RSS entry to show (none by default)
this.outputtemplate="<hr>{title} {label}<br />{date}<br />{description}<br /><br /><a href=' + feeds[i].link + '>Read more...</a>" // output template for each RSS entry
this.regexprules=[] // array to hold regexp rules [regex, replacestr, field_to_apply_to]
this.sortstring="date" //sort by "date" by default
document.write('<div id="'+divid+'" class="'+divClass+'"></div>') //output div to contain RSS entries
this.feedcontainer=document.getElementById(divid)
this.containertag=["li", "<li>"] // [tag to wrap around each rss entry, final tag]
this.onfeedload=function(){}
}
Thank you :)