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
Developer forum
E-mail notifications
Page navigation
Posted on 15/11/2009 17:08:44
Replies
Posted on 18/11/2009 08:45:02
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
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
Posted on 18/11/2009 10:04:53
What if I'm a front-end programmer, that knows just html and css :]
Is there a Javascript option?
Is there a Javascript option?
Posted on 18/11/2009 10:08:41
Yes, this could be done in JavaScript also.
- Lasse
- Lasse
Posted on 18/11/2009 10:18:44
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)-->
<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)-->
Posted on 18/11/2009 10:20:46
Absolutely awesome, thanks for your reply man :)
You must be logged in to post in the forum