Passer la navigation

[Résolu] Button or alternative

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

I want to use a phone number stored in a custom field as a dynamic button link so that when clicked, it dials the number (e.g., tel:+1234567890). However, the Toolset Button block does not support phone links.

Solution:

Use an HTML block instead of the Button block and insert the following custom code:

<a href="tel:[types field='phone-number' output='raw'][/types]" class="call-button">Call Now</a>

Replace 'phone-number' with the actual field name. This will generate a dynamic link that users can click to call the number directly from their mobile device.

Relevant Documentation:

https://toolset.com/forums/topic/display-a-phone-in-a-directory-website/

This support ticket is created Il y a 1 year, 3 months. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Ce sujet contient 1 reply, a 1 voix.

Dernière mise à jour par hoogeshD Il y a 1 year, 3 months.

Assisté par: Christopher Amirian.

Auteur
Publications
#2798811
2025-03-01 09 00 53.jpg

Tell us what you are trying to do?
Use the phone number from custom field in a Dynamic button. The button should become a url e.g. lien caché

Is there any documentation that you are following?
Could not find any.

Is there a similar example that we can see?
The call button on lien caché

What is the link to your site?
lien caché

#2798969

Christopher Amirian
Supporter

Les langues: Anglais (English )

Hi,

Welcome to Toolset support. The button block does not have the phone capability, instead I suggest that you use an HTML block and add the code below:

https://toolset.com/forums/topic/display-a-phone-in-a-directory-website/

So basically you will replace the link of the button with the types shortcode and add the name of the field there. In the example I mentioned in the linked ticket it was called cellphone.

Thanks.

#2799427

Thanks Christopher