logo
Home XtGem- Templates- XtScript- bottom

Paged rss feed xtscript function

This Xtscript function adds
to the standard XtGem rss reader
The pagination is created using XtGem pagination Blocks in the Xtscript
So Xtscript custom pagination can also be used
Css colors are for demo purposes only

Yahoo world news

Main CSS class names

You can change these in the scripts if you wish
xt_feed = outer container (purple)
xt_feed_select = feed selector container (blue)
xt_feed_title = feed title (red)
xt_feed_inner = inner container (yellow)
xt_feed_item = (cyan) added via template
xt_pagination = pagination container (green)

Settings Xtscript

must go above the main Xtscript

Main Xtscript

Must go below the settings Xtscript

Time ago xtscript/javascript

Must go below the main Xtscript
For "time ago" conversion to work
.pubDate. must be wrapped in a element named pubdate in the $template variable

XtScript paged rss feeds

Back to posts


Comments:
[2015-05-05] tda :

<!--parser:xtscript-->

Default feed \( title and url separate with | )

var \$default_feed=Yahoo world news|https://uk.news.yahoo.com/rss/world

More Feeds \( title and url separate with | ) \( feed data chunks separate with , I use separate lines for clarity )

var \$feeds=\$defaultfeed,BBC world news|http://feeds.bbci.co.uk/news/world/rss.xml
var \$feeds=\$feeds,Yahoo oddly enough|https://uk.news.yahoo.com/rss/oddly-enough
var \$feeds=\$feeds,BBC science and enviroment news|http://feeds.bbci.co.uk/news/science
and_environment/rss.xml

Other settings

var \$perpage=3
var \$items=0
var \$time
ago=1
var \$template=<div class="xtfeeditem"><a href=".link.">.title.</a><br /><div name="pubdate">.pubDate.</div>.description.</div>
get feed

Cookies

if \$feed
call cookie::set \$name=lastfeed;\$val=\$feed;\$expire=2419200;\$forcecurrent=1
else
var \$feed=call cookie::get \$name=lastfeed;\$default=\$defaultfeed
endif
<!--/parser:xtscript-->