jornes
October 25, 2023, 2:22am
1
Hi!
Thanks @Araminta for the video about Previous/Next Post.
Now, I want to do something like this. I have a CTA block, I want to display this block only when the current post is the newest (no next post) and hide it if the current page is neither the newest nor the oldest.
Here is the screenshot.
The block “
No Next Post Yet, Let Me Make Yours Next ”.
The Previous Post is so lonely there on the front end. So, I want to add a conditioned block when there is no next post.
How can I set the condition?
Thank you!
jornes
October 25, 2023, 3:26am
2
I already have the solution.
I use this Function Return
Hi @jornes ,
There is also another solution to this using Cwicly contexts:
As a temporary hacky workaround, we are currently using (within the dynamic context):
[Screenshot 2023-03-28 at 22.01.26]
This at least hides the blocks when there is no post to display for now.
You may also find this interesting:
When using a dynamic context to display previous or next post data, this works really well, except in the cases of the first and last posts.
Currently there is no built-in condition for us to check whether it is the first or last post to be able to hide the blocks displaying the next post data/link, so the next best solution would be to display the first post when there is no more next post to retrieve.
Here is an example of how this looks in code.
Thank you!
jornes
October 25, 2023, 8:24am
4
Hi @StrangeTech
Thank you for sharing this! I will check it out to find out.