Here’s why it’s not working, and what you need to do-
Hey! That’s extremely helpful! I just ran into one small issue:
<a class="WhatsappLinkBlock" href="https://wa.me/503{{wf {"path":"property-agent:agent-phone","type":"Phone"\} }}">
<div class="card-whatsapp-div">
<img src="https://global-uploads.webflow.com/6330db89fd7ec6b3b49cf99c/6331e1a7dfcbe0bde612bbca_whatsapp.svg" loading="lazy" alt="" class="image-2">
<div class="text-block-6">Contactar</div>
</div>
</a>
You could put the DIVs outside of the As, however then only the middle of your button will be clickable. This is why I said storing the full link in the CMS is best, you can just bind it directly to a BUTTON or LINK element.
The only thing is that I need to add the we.me link before every number. Is there a way that users can input their number but it stores as a separate link field as well as they submit the form?
Submit what form?
It sounds like you have some kind of realtor onboarding process, where realtors fill in a Webflow form to add themselves to the CMS? In Webflow, form posts do not go directly into the CMS, so you’ll always have something in-between to create those Form → CMS records… Zapier, Make, Logic, etc.
In that automation logic you can definitely clean the phone # and prefix it with https://wa.me/
, and then store that into a separate Whatsapp URL field in your CMS. That’s what you’ll bind to your button link.
Hey, I actually went with @choreus’s custom button. So that solved it!! Quick question, is there a way to open the link in a separate tab from that HTML embed?
Best,
Andres
Quick question, is there a way to open the link in a separate tab from that HTML embed?
You can add target="_blank"
to open a link in a new tab.
<a class="button" target="_blank" href="https://wa.me/INSERT-CMS-FIELD-HERE">Contactar
...
</a>
Read more about the target attribute below:
I tried the code and it won’t work. Does this only work for a Button or how can I make it work on a link block?