+1
Respuestas

Using [eval:] within a list

steve hace 12 años actualizado por icahill (Administrator) hace 12 años 1
I'd like to use a list to grab an rss feed but I only want to grab something like the most recent 10 items. It looks like I can use [eval:] to do this but I'm not quite sure how. Also, if I want to allow the user to grab more items than the first ten, is the best method to create an action that would assign a different number to the [eval:] setup?

Thanks
Your best bet here is to use conditional logic attributes on the object tag within your list.

We do this for feeds a lot.


<list name="twitter-list" alias="TWEET" width="100%" height="100%" datasource="twitter-feed" orientation="horizontal" paginate="no">
<object name="twitter" class="twitter-item" id="[param:dataSourceIndex]" tweet="[param:text]" lhs="[param:dataSourceIndex]" operator="lte" rhs="10"/>
</list>


This will cause the list to only render for the conditional statement listed, in this case it will display only the index numbers less than or equal to 10.