Hi,
I'm using elementor to build custom templates for my listings. I want to show a phone number, website and email for each listing.
I can easily get the website to be a link since it is set as an URL field, but I can't figure out how to make the phone number and email address also into a clickable link.
Any suggestion on how to do this? I don't want to use a Toolset view, but the elementor template.
Hi,
Thank you for contacting us and I'd be happy to assist.
To show Toolset Types' custom fields as links in the Elementor templates, you can use Toolset Types Fields shortcodes:
https://toolset.com/documentation/customizing-sites-using-php/functions
For example, if you have a Phone type custom field with slug "phone-number", its link with the Types field shortcode would look like this:
<a href="tel:[types field='phone-number' output='raw'][/types]">[types field='phone-number' output='raw'][/types]</a>
And, for an Email type custom field with slug "email-address", the link with the Types field shortcode would be:
[types field='email-address' title='Send an email'][/types]
Note: You can place this code, in any Elementor widget that supports HTML and shortcodes.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Thank you, this helps a lot with regards to the phone number.
I have a follow up question about the same type of problem.
On each of my profiles page I'd like to add a contact form that sends an email to the owner of the profile. Is this possible using toolset forms or do you recommend a plugin and then try to code in the shortcode in the plugins html code?
Thanks for the update and glad that my message helped.
I've split a new ticket for your question about the contact form and will follow up on it separately.
( ref: https://toolset.com/forums/topic/split-contact-form-that-sends-an-email-to-the-owner-of-the-profile/ )
You're welcome to mark this ticket as resolved and start a new one for each new question or concern.