Previous and Next post link in loop

Hi,

On this page http://www.holy-chic.nl/staging/projects/droomvilla/ I created the single layout with buttons to go to the next and previous post by linking to: {{dc:post:permalink post=“prev”}} and {{dc:post:permalink post=“next”}}

Now it stops (empty link) when there is no previous or next post. Is it posible to make this a loop so there is always a previous or next?

THX, Carel

Hi Carel,

Thanks for reaching out.
I have checked the given URL and found that the Prev and Next are showing the link properly. Can you please check and confirm?

Thanks

Hi!

The link is generated by {{dc:post:permalink post=“prev”}} and {{dc:post:permalink post=“next”}}.

Should I use something else?

I wil send you a login!

Hi Carel,

Unfortunately, the user does not have the privilege to access the Layouts. I would suggest you grant the Admin privileges to the user for further investigation. I would also like to inform you that your site is showing ERR_CONNECTION_TIMED_OUT on every alternative action.

Thanks

Sorry, I changed to Administrator and now also on https

Hi Carel,

You need to add a condition that the dynamic content {{dc:post:permalink post=“next”}} is not returned any blank value. I have added the same for the Next button and it worked. I would suggest you add the same condition with {{dc:post:permalink post=“next”}} for the Prev button.

Hope it helps.
Thanks

Hi!

Well this is a solution, now the next or previous button is hidden when there is no next or previous post.

But what I wantend is that the buttons are always there but display the posts in a loop so when you are at the last, it starts with the first again so for example 1 -2-3-4-1-2-3-4-1-2 etc. etc.

Do you have a solution to get that…?

THX, Carel

Hi Carel,

Unfortunately, that is not possible. But you can try with the Slider element which may help you to reach a similar output. Please go through the following article.

Hope it helps.
Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.