[solved] UDT to write alternative content for smartphones ?

Discuss, ask and suggest about Usability and Accessability with CMS Made Simple
Locked
VincentRivard
Forum Members
Forum Members
Posts: 10
Joined: Mon Feb 18, 2013 5:01 pm

[solved] UDT to write alternative content for smartphones ?

Post by VincentRivard »

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.
Last edited by VincentRivard on Tue Feb 19, 2013 4:03 pm, edited 1 time in total.
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

Re: Simple UDT to write alternative content for smartphones

Post by fredp »

Hi,

Do you think this RFC "recommendation" would help?
RFC3966: Usage of Telephone URIs in HTML
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
VincentRivard
Forum Members
Forum Members
Posts: 10
Joined: Mon Feb 18, 2013 5:01 pm

Re: Simple UDT to write alternative content for smartphones

Post by VincentRivard »

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.
uniqu3

Re: Simple UDT to write alternative content for smartphones

Post by uniqu3 »

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/
VincentRivard
Forum Members
Forum Members
Posts: 10
Joined: Mon Feb 18, 2013 5:01 pm

Re: Simple UDT to write alternative content for smartphones

Post by VincentRivard »

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.

Code: Select all

{cge_is_smartphone assign='mobile'}{if $mobile}<a href="tel:555 5555">555 5555</a> 
{else}555 5555{/if}
uniqu3

Re: [solved] UDT to write alternative content for smartphone

Post by uniqu3 »

Glad it worked for you ;) and thanks to your client for showing you CMSMS, welcome!

Happy coding.
Locked

Return to “[locked] Accessability and Usability”