AjaxyXml Plugin for Mephisto ============================ This plugin provides a liquid tag for use with Mephisto that inserts an Ajax call into your blog that will fetch an XML file and parse it for you. The benefit of this is that you can put dynamic content on your blog without having to worry about your caches. You also don't have to worry about an external XML file slowing down your blogs loading time if the server it's on is slow or down at the moment. Installation ============ This version of AjaxyXML should only work with 0.8 of mephisto so if you haven't updated yet (it took me FOREVER to finally update mine), go ahead and do that. There also shouldn't be any extra special instructions for getting this to work. Just check out the repository into your vendor/plugins directory.. If you want to maintain it yourself and want to use SVN itself.. svn co http://svn.dnite.org/mephisto_ajaxyxml/trunk vendor/plugins/ajaxyxml .. or use the plugin script .. script/plugin install -x http://svn.dnite.org/mephisto_ajaxyxml/trunk Should be ready now! Usage ===== Using this plugin is quite easy. A URL and element ID are both required. The quantity is optional. If you leave off the quantity, AjaxyXml will just assume you want all items. This tag will only generate the Ajax request to update an element. You will have to place the element you wish to update somewhere else on your blog yourself. I did this on purpose to give you more freedom about how to style and where to put the element. {% ajaxyxml url: 'http://url.to/file.xml', element: 'element_id', quantity: 10 %} A more real life example would be something like below (for twitter status)...
Loading Twitter Status...
{% ajaxyxml url: 'http://twitter.com/statuses/user_timeline/swemoney.xml', element: 'twitter_status', quantity: 1 %} Or if you want to display Last.fm information on your blog...
Loading Last.fm Inforation...
{% ajaxyxml url: 'http://ws.audioscrobbler.com/1.0/user/tehdnite/recenttracks.xml', element: 'lastfm' %} The above examples will embed an Ajax call to your blog. This Ajax request will be looking for a liquid partial file called _ajaxy_elementid.liquid. So lastly, we'll need to create that in our Admin/Design panel in Mephisto. _ajaxy_twitter_status.liquid

Twitter Status: {{ xml.text }} created on {{ xml.created_at }}

_ajaxy_lastfm.liquid

{{ ajaxyxml.index }} :: {{ xml.artist }} - {{ xml.name }}

As seen above, the liquid variable {{ xml }} contains the current item in the XML file. Also, if you wish to use the current index, {{ ajaxyxml.index }} can give you that. HAVE FUN!! If you have any problems with this plugin, please contact tehdnite at gmail or go to http://blog.dnite.org (C) Steve 'dnite' Ehrenberg 2007 under an MIT licence. http://www.opensource.org/licenses/mit-license.php