Developer forum

Forum » Development » Page navigation

Page navigation


Reply
Hey there DWebbers,

Short question.

@Ecom:ProductList.PrevPage (or the clean version) both do generally the same thing. They create a link to /Default.aspx?ID=2&GroupID=&PageNum=1, for example.

Now what I'd like, is to build that url myself, or at least replace /Default.aspx with an url of my own. Alternatively (and perhaps even better) it would be fine to get the PageNum of the next page, somehow.

Any ideas how to do this? I do hope I clarified my issue :)

- Dirk

Replies

 
Reply
Hi Dirk

The number of the next page is not rendered to the template, but the current page number and total number of pages are. Using an XSLT template you can use these to calculate the number of the next page.

Another thing you can do, is to write a ProductListTemplateExtender and render all the tags you want to your product list template.

 - Lasse
 
Reply
What if I'm a front-end programmer, that knows just html and css :]

Is there a Javascript option?
 
Reply
Yes, this could be done in JavaScript also.

 - Lasse
 
Reply
Something like this:

<script type="text/javascript">
    var currentPage = <!--@Ecom:ProductList.CurrentPage-->;
    function redirectToNextPage() {
        var nextPageNum = currentPage + 1;
        location = 'default.aspx?ID=something&PageNum=' + nextPageNum;
    }
</script>
<!--@If Defined(Ecom:ProductList.NextPage.Clean)-->
    <a href="javascript:redirectToNextPage()">Next page</a>
<!--@EndIf(Ecom:ProductList.NextPage.Clean)-->

 
Reply
Absolutely awesome, thanks for your reply man :)

 

You must be logged in to post in the forum