ASPX templates
Version 5.x > ASPX templates > Using WhereCondition SelectTopN to display 1 news source in 3 columns View modes: 
User avatar
Member
Member
smcguire-coj - 10/21/2010 2:49:29 PM
   
Using WhereCondition SelectTopN to display 1 news source in 3 columns
Hi,

I'm attempting to create a three-column layout that pulls from the same news source. I want to display the 1st 10 (1-10) news items in the 1st column, the second 10 (11-20) in the second column, and the third 10 (21-30) in the third column.

For the second column, listing items 11-20, I thought I could do something like this:
Path="../%"
OrderBy="NewsReleaseDate DESC"
SelectTopN="20"
WhereCondition="[what goes here?] > 10"

And for the third column, listing items 21-30, something like this:
Path="../%"
OrderBy="NewsReleaseDate DESC"
SelectTopN="30"
WhereCondition="[what goes here?] > 20"

I'm not sure what value to compare against in the WhereCondition. I can't use NewsReleaseDate because I'm not comparing dates. Is there a way to refer to the SelectTopN rows, once they're selected?

Alternately, is there a better way to do this? Perhaps something to do with hidden pagination?

Thanks,
Sherry

User avatar
Member
Member
smcguire-coj - 10/21/2010 4:33:59 PM
   
RE:Using WhereCondition SelectTopN to display 1 news source in 3 columns
I solved the problem using pagination.

For each CMSRepeater:

Path="../%"
OrderBy="NewsReleaseDate DESC"
SelectTopN="15"
EnablePaging="True"
PagerControl-PageSize="5"
PagerControl-CurrentPage="3"
PagerControl-ControlCssClass="hide"

The PagerControl-CurrentPage = "1" for column 1, "2" for column 2, and "3" for column 3.

The css class of hide is defined in the style sheet:
.hide {display:none;}