ASPX templates
Version 3.x > ASPX templates > Implement Paging Menu which redirects to Details page View modes: 
User avatar
Member
Member
tim - 1/10/2012 9:13:59 AM
   
Implement Paging Menu which redirects to Details page
I am having one landing page of News in which I need to display top 2 latest news only. Below the top 2 news section, I need to implement a kind of pager which will be displaying something like "<< browse news 1 2 3 4 5 >>"

Here is the detail of above kinda pager requirement:
<< ----- previous
1 ------ 1st news
2 ------ 2nd news
3 ------ 3rd news
4 ------ 4th news
5 ------ 5th news
>> ----- next (on clicking this, I need to display << 6 7 8 9 10 >> )

On clicking any of the above button, I need to redirect user to respective News details screen.

As of now, I have used one repeater with "top 2" for creating my top section, but bottom section of paging is not understood by me. I have tried "enable paging for repeater" but that's only working for 2 records. Also, instead of redirecting to details screen, it is changing my top repeater's record.

I have also tried UnivPager, but that is also not serving my purpose.

Please help me out in getting this done.

thanks
timcy

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/12/2012 2:58:29 AM
   
RE:Implement Paging Menu which redirects to Details page
Hello,

Actually, the Universal pager could be a solution for you. So please leave your top 2 news repeater unchanged and add a new one under it, which will display only one of the news. Its properties could look like these below:

Web part control ID*: newsrepeater
Path: /News/%
Document types: CMS.News
Maximum nesting level: 1
ORDER BY expression: DocumentCreatedWhen DESC
Transformation: CMS.News.NewsDetail


And finally please add the Universal pager web part under your newsrepeater and specify following properties:

Target control name: newsrepeater
Page size: 1
Paging mode: QueryString
Querystring key: page
Group size: 5


The pager should work now as you wanted to.

Best regards,
Jan Hermann

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/12/2012 3:03:23 AM
   
RE:Implement Paging Menu which redirects to Details page
Hello,

It you don't want to display news on the document with a repeater, but redirect user to a actual page of that news, you can use a repeater as it was mentioned in my first post, but now the "pager" will be rendered only by this repeater and its transformation. The properties of that repeater web part will be also the same, except the transformation (and you will need to fill 3 more properties - where condition, content before and content after). Here is an idea:

1) Transformation displays links in numbers according actual pager position from a query string
2) Where condition select documents, which aren't in top N documents also from query string
3) Content before/after generates links, which increas/decrease query string by 5 (number of items)

Just one more thing, you will need to use logic operation in your transformation, so please choose its type as the Text/XML one and this mentioned transformation could look like the following one:

{%
if (QueryString.GetValue("news") > 0) {news = QueryString.GetValue("news")}
else {news = 1}
item = DataItemIndex.ToInt() + news.ToInt();
"";
%}</a> 

Best regards,
Jan Hermann