Questions answered by this recipe
How can I show list items (Trail) or an RSS feed as a newsticker?
+ jticker.php + jticker |-- jquery.easing.js |-- jquery.innerfade.js |-- jticker.xslt |-- style.css
jticker.php into your cookbook directory on your server and the jticker folder into your (farm) pub-directory. Then add the following to your localization file
Please note: The configuration options must be set before the include (see above)!
This is the URL to load the jQuery Core from. Default is
https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js. You may change this if you have a local jQuery installation.
Animation speed in milliseconds. (higher values = slower). Default: 2000
Time in milliseconds to show each item (higher values = longer). Default: 5000
Easing effect to use. Default: 'linear'
Height of the ticker container. You may have to tweak this value. Default: '1em'
To tweak the layout, patch the
Example (put into your
$jtickerspeed=600; $jtickertimeout=800; include_once($FarmD.'/cookbook/jticker.php');
Newsticker from unordered list
To create a newsticker from a page containing a list, use this markup:
(:pagelist trail=<TrailPage> fmt=jticker:)
Newsticker from RSS feed
To load an RSS feed an create a ticker from the contents, use:
(:jtickerRSS feed=<Feed-URL> [cachetime=<time>] [cachename=<Name>] [maxitems=<Number>] :)
The only option required is (of course) feed. Put the URL of the feed there.
As the code is based on the InlineRSS Recipe, read that recipe for the other options.
Change log / Release notes
- Fixed for use with PHP 5.5
- First release.