Contact phone numbers not 'clickable'

Need help with the Administration of your Joomla! 3.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
User avatar
VThomas
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Tue Oct 23, 2007 2:49 pm

Contact phone numbers not 'clickable'

Postby VThomas » Mon Jun 19, 2017 7:03 pm

I've noticed that what used to work does not now ... browsers would recognize phone numbers on smart phones and they were 'clickable'. Now, not clickable on mobile as before, and now too sometimes users want numbers 'clickable' on their larger devices too. So ... now I have to add an 'a' tag, similar to:

Code: Select all

<a href="tel:+1-111-222-3333">111-222-3333</a>


I need to update an old site that has ~50 contacts. I thought about using the contacts component. But, phone numbers are not clickable as is. How can I edit (and which file) to add the phone number entered to an 'a' tag when presented on the web page, to make the number 'clickable'?

I spent quite a bit of time looking at demos today that enhance the contacts component, but could not find one that adds this a tag.

Thanks, Vicky
An old dog can learn new tricks - I saw it on Mythbusters!

User avatar
websitedons
I've been banned!
Posts: 393
Joined: Sat May 27, 2017 9:42 am

Re: Contact phone numbers not 'clickable'

Postby websitedons » Mon Jun 19, 2017 8:10 pm

I don't think there is a method to enable phone hyperlink. What worked before may have been an edit of the contact template, and it may have been a core file hack instead of an override, so an update erased the change.

You can create an override of the contact component, then edit default_address.php and change the phone output as follows.
Change

Code: Select all

<span class="contact-mobile" itemprop="telephone">
   <?php echo $this->contact->mobile; ?>
</span>

To

Code: Select all

<span class="contact-mobile" itemprop="telephone">
   <a href="tel:<?php echo $this->contact->mobile; ?>"><?php echo $this->contact->mobile; ?></a>
</span>

User avatar
VThomas
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Tue Oct 23, 2007 2:49 pm

Re: Contact phone numbers not 'clickable'

Postby VThomas » Mon Jun 19, 2017 9:23 pm

Thank you very much!
An old dog can learn new tricks - I saw it on Mythbusters!


Return to “Administration Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 9 guests