<se:region error="Invalid request">
{buffer.set(dt, request.query('m', default='200901'))}
{buffer.set(dtfrom, datetime.setdate(datetime.now(), string.substring($dt, 0, 4), string.substring($dt, 4, 2), 1))}
{buffer.set(dtto, sys.iif(request.query.exists(m), datetime.addmonths($dtfrom, 1), datetime.addyears($dtfrom, 100)))}
<se:sqlquery error="{this.error.message()}">
<se:parameters>
<se:parameter name="sql">
SELECT TOP 10 c.Nr, c.Title, c.Body, c.Author, c.AddDate, c.Code
FROM {channel.view()} c
JOIN Contenttypes ct ON c.Contenttype=ct.Nr
WHERE ct.Code = 'NWS'
AND (adddate BETWEEN ?:fromdate AND ?:todate)
ORDER by c.AddDate DESC
</se:parameter>
<se:parameter name="params">
<se:collection>
<se:member name="fromdate" type="datetime">{buffer.get(dtfrom)}</se:member>
<se:member name="todate" type="datetime">{buffer.get(dtto)}</se:member>
</se:collection>
</se:parameter>
<se:parameter name="format">
<se:rowformat expression="cms.ischildof(this.field(nr),translation.arg(2, default=itemdata.number()))">
<div class="news">
<div class="newsheader">
<div class="newstitle">
<a href="{channel.link(this.field(nr))}"><h2><span>{this.field(title)}</span></h2></a>
</div>
</div>
<div class="newsbody">
<div class="newstext">
{sxml.execute(this.rawfield(body))}
</div>
</div>
</div>
</se:rowformat>
</se:parameter>
<se:parameter name="resultformat">
{this.result()}
</se:parameter>
<se:parameter name="default">
<p>No news items.</p>
</se:parameter>
</se:parameters>
</se:sqlquery>
</se:region>
|