views:

13

answers:

0

I'm trying to import items from a XML RSS feed and use Spry to show recent blog posts in a blog on a site. It works fine, but I want to show just the first 30 characters followed by an ellipsis. I can't seem to find a way to shorten the spry element since in the region, {description} will not be evaluated before the surrounding code so I can't do

    var ds1 = new Spry.Data.XMLDataSet("/xml-rss2.php", "rss/channel/item",{sortOnLoad:"pubDate",sortOrderOnLoad:"descending"});
ds1.setColumnType("pubDate", "date");

[snip]

  <div spry:region="ds1">                               
         <div class="entry" spry:repeat="ds1">
                <a class="date" href="{link}">{title}</a><br />
                            <div class="description" spry:content="{description}.slice(0,30);">
                                              </div>
</div>
</div

Am I missing something?