Hi there,
First post here. French is my native language. Sorry if any language bloopper.
Most smartphones get
<a href="tel:1 800 555 5555">Call us free!</a>
and dial the number, but I dont want the link to get in the way for non smartphones, since the client cant afford an alternative version for them.
How could I detect smartphones and write
<a href="tel:1 800 555 5555">Call us free!</a>
else
1 800 555 5555
I dream of a simple UDT since it would be used on many pages.
[solved] UDT to write alternative content for smartphones ?
-
- Forum Members
- Posts: 10
- Joined: Mon Feb 18, 2013 5:01 pm
[solved] UDT to write alternative content for smartphones ?
Last edited by VincentRivard on Tue Feb 19, 2013 4:03 pm, edited 1 time in total.
Re: Simple UDT to write alternative content for smartphones
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
- Abraham Lincoln
-
- Forum Members
- Posts: 10
- Joined: Mon Feb 18, 2013 5:01 pm
Re: Simple UDT to write alternative content for smartphones
Hi fredp,
Yes it would help a bit, but not for writing an UDT to detect smartphones, which was the question.
Thank you for this information. If i can find a way to do so, the phone number will be properly displayed according to those recommendations.
Yes it would help a bit, but not for writing an UDT to detect smartphones, which was the question.
Thank you for this information. If i can find a way to do so, the phone number will be properly displayed according to those recommendations.
Re: Simple UDT to write alternative content for smartphones
You can look at CGExtensions or ToolBox modules, both come with Mobile detection plugins/functions, just read Module Help to find out how and where.
Else you can go with a custom made UDT or Plugin using for example Mobile Detect Class that can be found here http://code.google.com/p/php-mobile-detect/
Else you can go with a custom made UDT or Plugin using for example Mobile Detect Class that can be found here http://code.google.com/p/php-mobile-detect/
-
- Forum Members
- Posts: 10
- Joined: Mon Feb 18, 2013 5:01 pm
Re: Simple UDT to write alternative content for smartphones
Thanks uniqu3,
i have just had a quick look at these ressources and it seems everything i need is there.
Sorry for my 'newbie' question. It's the first time i play with CMSMS, and i like it a lot already.
The client is familiar with it, and introduced (forced) it to me.
Glad he did.
Got this from CGExtensions. It needs to be installed.
i have just had a quick look at these ressources and it seems everything i need is there.
Sorry for my 'newbie' question. It's the first time i play with CMSMS, and i like it a lot already.
The client is familiar with it, and introduced (forced) it to me.
Glad he did.
Got this from CGExtensions. It needs to be installed.
Code: Select all
{cge_is_smartphone assign='mobile'}{if $mobile}<a href="tel:555 5555">555 5555</a>
{else}555 5555{/if}
Re: [solved] UDT to write alternative content for smartphone
Glad it worked for you and thanks to your client for showing you CMSMS, welcome!
Happy coding.
Happy coding.