This uses the custom button card, which is installable via HACS, or can be installed manually. That card supports templating itself, rather than being a Lovelace feature. It’s a very powerful card. I have been able to make some really nice dashboards with it. I highly recommend reading the documentation at that link and experimenting with it.