Jahia Template Forum > Next and Previous...

0 (0 Good)
0 (0 Bad)

Next and Previous button in a page

by  peterreyan »  2011/06/07 19:59

Hi All
i want to implement Next and Previous button in my page,so if i click on Next page i will go to next page and same in case of Previous.

i have tried to fetch the stories based on lastpublishingDate. but

lt;query:equalTo propertyName=
  • Next and Previous button in a page
    2011/06/07 19:59

    peterreyan Hi All<br/> i want to implement Next and Previous button in my page,so if i click on Next page i will go to next page and same in case of Previous.<br/><br/>i have tried to fetch the stories based on lastpublishingDate. but <br/><br/>lt;query:equalTo propertyName=

  • Number of messages  5
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Next and Previous button in a page

    by  pap@commaro.com »  2011/06/07 19:59

    Hello Peter,

    can you please post the entire query and the corresponsing definition in the cnd ?

    Thanks,
    Benjamin

    Benjamin Papez (pap@commaro.com)

    Number of messages  220
    Registration date
    0 (0 Good)
    0 (0 Bad)

    Re: Next and Previous button in a page

    by  peterreyan »  2011/06/07 19:59

    Hi Benjamin
    [b:1aopl3by]
    the entry in the cnd is as follows[/b:1aopl3by]

    [templates:baseContainer] gt; jnt:container

    smallText Title
    smallText SubTitle




    i will try to fetch the value based on publishingdate and display it title.

    i have to implement NEXT and Previous . so i get the complete list i have to find the story after and before the current page.

    so,First i am trying to get the complete list based on publishing date .then i will try to go ahead.if you have any other way to achieve the same plz help me out.
    [b:1aopl3by]
    The query code is as follows .[/b:1aopl3by]

  • Re: Next and Previous button in a page
    2011/06/07 19:59

    peterreyan Hi Benjamin<br/>[b:1aopl3by]<br/>the entry in the cnd is as follows[/b:1aopl3by]<br/><br/>[templates:baseContainer] gt; jnt:container<br/><br/>smallText Title<br/>smallText SubTitle<br/><br/><br/><br/><br/> i will try to fetch the value based on publishingdate and display it title.<br/><br/>i have to implement NEXT and Previous . so i get the complete list i have to find the story after and before the current page.<br/><br/>so,First i am trying to get the complete list based on publishing date .then i will try to go ahead.if you have any other way to achieve the same plz help me out.<br/>[b:1aopl3by]<br/>The query code is as follows .[/b:1aopl3by]<br/><br/>

  • Number of messages  5
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Next and Previous button in a page

    by  pap@commaro.com »  2011/06/07 19:59

    Hello Peter,

    can't you solve your problem with the built-in pagination by using

    lt;template:containerList ... windowSize=

    Benjamin Papez (pap@commaro.com)

    Number of messages  220
    Registration date
    0 (0 Good)
    0 (0 Bad)

    Re: Next and Previous button in a page

    by  peters »  2011/06/07 19:59

    Thanks a lot benjamin for your help .Actually,if we use built-in pagination , i will get page like 1-gt;2-
  • Re: Next and Previous button in a page
    2011/06/07 19:59

    peters Thanks a lot benjamin for your help .Actually,if we use built-in pagination , i will get page like 1-gt;2-

  • Number of messages  35
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Next and Previous button in a page

    by  pap@commaro.com »  2011/06/07 19:59

    Yes, indeed. Unfortunately we have removed the distinct pagination tags available in jahia 5 and now the pagination controls cannot be customized or hidden easily. I was not happy with that and already opened a JIRA to allow more customization: http://jira.jahia.org/browse/JAHIA-4212
    So such a requirement to only display Previous and Next links withoug the page indexes in between should perhaps be solvable within that JIRA.

    So for now you could perhaps only do a workaround and again remove the automatic pagination. Instead you could create your own Next and Previous links and pass the date of the current entry as parameter to the next request and then get the 2 next containers with higher date (query sorted by date ASC), to display the next one and also whether another Next link should be displayed or not. You would need to make a second query returning maximum one result to check whether there is a container with a date before the current one, to know if the Previous link should be displayed.
    If clicking on the Previous link the next request should make a query returning max. 2 containers with dates lower than the given (query sorted by date DESC).

    Regards,
    Benjamin

    Benjamin Papez (pap@commaro.com)

    Number of messages  220
    Registration date
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page