Forum Discussion

hroppanen's avatar
11 years ago

How to get page number in thread?

You can get page number if it is in the path like this <#assign page_number = webuisupport.path.parameters.name.get ("page") /> but what if there is no path parameter. Like when going straight from the latest post list there is no path parameter. How to get paging number in all cases?

3 Replies

  • Does anyone have solution for this? All I need to know is this the first page or not.

     

    I wouldn't like to use javascript to check that if there is a paging element and does the first element have a link.

  • asalem2014's avatar
    asalem2014
    Contributor
    11 years ago

    <#if webuisupport.path.parameters.name.get("page") ??> <#assign pageNum = webuisupport.path.parameters.name.get("page")?number /> <#else> <#assign pageNum = 1 />

  • hroppanen's avatar
    hroppanen
    Ace
    11 years ago

    Hi asalem2014 

     

    Thanks for your reply but this isn't helping when going straight to other than the first page. Path parameter is not needed in the url. You can see that if you click permalink of a post .