Display a URL inline in a Label Object

Hi all!
I hope you’re doing well :slight_smile:

I looked on Anvil doc and on this forum, but I couldn’t find an answer to my question: I simply want to add a URL link inline inside a Label object. For now, I have this sentence in the text property of my Label:

You can also support the show and unlock exclusive Bayesian swag at Learning Bayesian Statistics | creating a podcast on Bayesian inference & the people making it | Patreon

However, the link is just plain text. How can I get a URL in there? I’d do this if I were in an HTML doc:

You can also support the show and unlock exclusive Bayesian swag on <a href="patreon.com/learnbayesstats">Patreon</a>

Thanks a lot in advance for your help and please excuse me if this is somehow a duplicate of another question :pray:
Alex

PS: Love Anvil BTW, thanks a lot, it’s really great :wink:

1 Like

Hi @andorra.alexandre and welcome to the forum

Some options:

  • not that pretty but one way would just be to add a custom html component and put the html straight in there…

  • If this is going to be a on all pages - in the footer say - you might want to edit Anvil’s html template directly.

  • Using anvil components you’d probably want to put the label and link component in a flow panel…

1 Like

Thanks @stucork, I had the same issue, is it the custom html component you mention?

1 Like

exactly
custom html form --> properties --> edit html
then just type in the html you need.

Use it as a custom component and put in your main form.

2 Likes

Thank you, I will give it a try

1 Like

Thanks a lot @stucork, this was very helpful!

I tried that at first but I couldn’t make it work and it’s really cumbersome anyway because, IIUC, you need one component each time you alternate between plain text and link.

I went with that and it worked :tada: TBH though, I didn’t really understand the part about “drop zones” and what they are used for in this tutorial. I tried a bunch of different things based on the code in there and it ended up working but I don’t have a deep understanding of why, so my solution may not be reproducible :man_shrugging:

Learnings: I spent quite a few hours implementing this, so I’d humbly recommend – again, I’m no expert here – at least clearing up a bit the explanation about drop zones (without those it didn’t work but I didn’t understand why).
Even better: having an easier way to get this basic functionality in Anvil would be awesome! I’m pretty sure it’s not “basic” to implement for Anvil devs, but I’m using that word as “it’s something you’d expect because it’s used very often” – you can do that on GitHub comments, on this very Discourse, on your email client, etc.

Hope this feedback is useful and, above all, thanks a lot for your help :vulcan_salute: