Clickable Phone Number in Contacts

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
sp1d3r
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Tue Mar 18, 2008 9:02 pm

Clickable Phone Number in Contacts

Post by sp1d3r » Wed Jun 15, 2011 7:44 pm

When using the standard contact component in 1.6, how can I make the phone numbers clickable when viewing via mobile browser?

Thanks

kina
Joomla! Guru
Joomla! Guru
Posts: 869
Joined: Sun Feb 14, 2010 2:47 am
Contact:

Re: Clickable Phone Number in Contacts

Post by kina » Wed Jun 15, 2011 7:55 pm


sp1d3r
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Tue Mar 18, 2008 9:02 pm

Re: Clickable Phone Number in Contacts

Post by sp1d3r » Wed Jun 15, 2011 7:58 pm

kina wrote:Maybe have a look at : http://www.phonemashup.com/f476528/ifby ... la-drupal/
J1.5
Maybe have a look at my original post
1.6
I'm looking to edit the core component, not install a band-aid.

kina
Joomla! Guru
Joomla! Guru
Posts: 869
Joined: Sun Feb 14, 2010 2:47 am
Contact:

Re: Clickable Phone Number in Contacts

Post by kina » Wed Jun 15, 2011 8:04 pm

I'll ignore the abuse. I said it was 1.5 - take a look. Hence I'm going no further with editing the core component. If you're so smart - do it yourself!

A better link for others who need this :

http://joomlatp.com/joomla-1.5-modules/ ... calls.html

Moderator Note: Please remember to keep discussions civil.
Last edited by Geoff on Sun Jun 19, 2011 12:31 am, edited 1 time in total.
Reason: Keep discussions civil.

sp1d3r
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Tue Mar 18, 2008 9:02 pm

Re: Clickable Phone Number in Contacts

Post by sp1d3r » Wed Jun 15, 2011 8:10 pm

kina wrote:I'll ignore the abuse. I said it was 1.5 - take a look. Hence I'm going no further with editing the core component. If you're so smart - do it yourself!

A better link for others who need this :

http://joomlatp.com/joomla-1.5-modules/ ... calls.html
Hey guy stop spamming my thread, I'm running Joomla 1.6, hence why I'm in the J1.6 forum. Your links are for a module built for Joomla 1.5.

Plus a module will not fix a core issue, maybe a plugin not a module.

As an edit, I just read the module description to the link above. That module adds a place for your customers to enter their phone number and have it auto call you.

This is not what I want to do. Maybe I was not clear in my first post. All I want is to have the phone numbers within a contact be clickable when viewing via a mobile web browser.

Doing google searches I find this code

Code: Select all

<a class="tel" href="tel:8001234567">(800) 123-4567</a>
Which seems like it would work, I just need to know which file to edit within the contact component. I was thinking it is around here - components/com_contact/views but not sure where to update the code.

If anyone has any ideas please reply.

FYI, this forum gets indexed fast. My post kept showing up in google when looking for the answer.

sp1d3r
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Tue Mar 18, 2008 9:02 pm

Re: Clickable Phone Number in Contacts

Post by sp1d3r » Wed Jun 15, 2011 8:46 pm

In components/com_contact/views/contact/tmpl/default_address.php

I found this

Code: Select all

<span class="<?php echo $this->params->get('marker_class'); ?>" >
		</span>
		<span class="contact-webpage">
			<a href="<?php echo $this->contact->webpage; ?>" target="_blank">
			<?php echo $this->contact->webpage; ?></a>
		</span>
I was hoping by modifying the few lines above, I could use

Code: Select all

<a class="tel" href="tel:8001234567">(800) 123-4567</a>
So I tried it, looks like this

Code: Select all

<?php if ($this->contact->mobile && $this->params->get('show_mobile')) :?>
	<p>
		<span class="<?php echo $this->params->get('marker_class'); ?>" >
			<?php echo $this->params->get('marker_mobile'); ?>
		</span>
		<span class="contact-mobile">
			<a href="tel:<?php echo $this->contact->mobile; ?>">
			<?php echo $this->contact->mobile; ?></a>
		</span>
	</p>
But still not working. Any ideas?

sp1d3r
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Tue Mar 18, 2008 9:02 pm

Re: Clickable Phone Number in Contacts

Post by sp1d3r » Wed Jun 15, 2011 9:03 pm

o Joomla and your awesome ability to have template overrides, I totally forgot about you.

By the way it does work above. I had to edit the override file. *facepalm* I'm a noob.

Anyways, if you are looking for this solution, here you go.

User avatar
PhilD
Joomla! Hero
Joomla! Hero
Posts: 2737
Joined: Sat Oct 21, 2006 10:20 pm
Location: Wisconsin USA
Contact:

Re: Clickable Phone Number in Contacts

Post by PhilD » Sat Jun 18, 2011 4:30 am

This works also:

Code: Select all

<?php if ($this->contact->mobile && $this->params->get('show_mobile')) :?>
	<p>
		<span class="<?php echo $this->params->get('marker_class'); ?>" >
			<?php echo $this->params->get('marker_mobile'); ?>
		</span>
		<span class="contact-mobile">
		<a href="tel:<?php echo $this->contact->mobile; ?>">
			<?php echo nl2br($this->contact->mobile); ?></a>
		</span>
	</p>
<?php endif; ?>
but what purpose do you want it clickable? Firefox just pops up an error message saying I don't know what to do.
PhilD

sp1d3r
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Tue Mar 18, 2008 9:02 pm

Re: Clickable Phone Number in Contacts

Post by sp1d3r » Tue Jul 19, 2011 7:30 pm

For viewing on a mobile device. Click the number to have it prop to call the number.


Locked

Return to “General Questions/New to Joomla! 2.5”