Previous Next Icon Display Only If There is an Item

  • I was able to use either text >> or an icon to display in the Previous Next text block within Elements. Here is an example:{{post_title source:next-post|link:post}} >>

    How do we control the icons or >> to not show if say there is no NEXT post or PREVIOUS post? When there is no next post, I see >> but no post title.

    Any ideas?

  • Hi Ian,

    Can you try ticking the required to render box when editing the dynamic tag?

  • Hi Ying,

    Yes, “Required to render” is checked. Yet on a post with no Next, the Icon still shows. Any ideas?

  • Hi Ian,

    Instead of manually adding >> as icon, try adding it using the built-in Icon feature instead: https://cln.sh/C9T5w7WxyhDjKtKJsQrN

    I’ve tested this, and it should work correctly.

  • Hi Alvind, I actually also tried using the built in icon but still the same. Let me provide a login and links to the specific issue. Would you mind taking a look?

    Required to render is checked, here are the dynamic tags:

    {{post_title source:previous-post|link:post}}

    {{post_title source:next-post|link:post}}

    Very odd.

  • Okay, you can do this:

    1. Set the Text block tag name to a.

    2. In the text block, insert the Post Title dynamic tag.

    3. Under Link Destination, insert the Post Permalink dynamic tag.

    Here’s a screenshot for reference: https://cln.sh/Fv53WM8Qb6JWYNcCJgJ2

  • Hi Alvind,

    I see what you did there. Before I give that a try, the icon is no longer showing up when there is no Next or Previous. What was the fix?

  • Quick update Alvind. Again, not sure if anything was fixed. Next works properly but Previous does not. Let me update the private URLs below. Mind taking a look? Any ideas?

  • That’s odd. Both Next and Previous links are working on my end now, and I didn’t make any changes.

    It could be a browser cache issue – when I tested on different browsers, the problem didn’t appear.

  • Interesting. It’s a staging site with all caching disabled. Maybe browser indeed. All fixed for now. Thanks all!

  • Quick update. When I edit either Next or Previous, the same issue happens. Code is identical as previously but items disappear. When I revert the page back to the previous day, they return to normal. Can’t help but think there could be a bug somewhere. Wanted to report this.

  • Can I see the issue? Maybe create a new page with the same setting to see if the issue happens in the new page?

  • Thanks Ying! I just sent a private login with more details.

  • I created a test post and a test content template, edited the next link font-size and color, saved the change, and I do not see the issue you described, the link is showing correctly.

    Can you make it happen?

  • Oddly enough, I cannot trigger it anymore. I have reverted to a version that broke from earlier this morning but now, it works properly. Feel free to try on your end if you think there is something else you can use to trigger the glitch.

  • I am not able to trigger it, unfortunately!

    Let me know if it happens again.

Viewing 16 posts - 1 through 16 (of 18 total)
  • You must be logged in to reply to this topic.