Search

I just noticed that there doesn’t appear to be an option to limit the results returned from a Dynamic XML datasource. I was hoping to cut the amount of twitter entries shown down to 2, any ideas?
I’m assuming it’s easiest to just write it in XSL, but I’m not quite sure how to do that.

I do this in my Show latest Last.fm plays on your Symphony site tutorial. The “Included Elements” field allows you to specify the XPath of elements to include. I’m not sure of your XML structure, but you could do something like:

//status[position() <= 2]

This will grab the first and second (less than or equal to two) status elements.

Awesome as always, thanks nick :)

If you wanted to shave a few milliseconds off, you could also limit at the twitter API call using the count parameter:

http://twitter.com/statuses/user_timeline.xml?count=2

edit:

Without authenticating, it would be (for ‘ashooner’):

http://twitter.com/statuses/user_timeline/ashooner.xml?count=2

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details