Be aware of the subtle difference with ->template() - that will return the final template … for example, Kirby witll fall back to the default template if the template you wanted does not exist.
Thanks both for this. I’m getting pretty close, but it’s not quite right. I have children of a page that have one of two templates - UpcomingPenpal or ActivePenpal, and I want the button to change based on this template. Here’s what I have currently:
But all the buttons are being rendered with the “Read our conversation” part of the if, so it doesn’t seem to be matching the UpcomingPenpal template for some reason.
Thanks.
Just showing that the template name of the children is correct:
The dump gave me the clue I needed, thanks! It wasn’t honouring the uppercase letters, so changing it to upcomingpenpal instead of UpcomingPenpal did the trick. Thank you so much!