Textpattern plugin - detect mobile browser

pro_mobile plugin


Demo text below, use mobile device or simulator to view it:

Demo text start – – Demo text stop


Handy little wrapper tag to display different content/code to mobile browsers, needed it, made it, shared it :)

Version 0.4, ‘opera mobi’ agent supported now!

Download at GitHub



Option 1:

<txp:pro_mobile> // Show mobile content here </txp:pro_mobile>

Option 2:

Use as an if/else:

<txp:pro_mobile> // Mobile content here <txp:else /> // Regular content here </txp:pro_mobile>

Option 3:

Define custom content per browser

<txp:pro_if_mobile name="iPad" > You have an iPad lucky thing! </txp:pro_if_mobile>

Names available for you to use include:

  • iphone
  • ipod
  • ipad
  • aspen
  • nexus
  • dream
  • android
  • cupcake
  • blackberry9500
  • blackberry9530
  • opera mini
  • opera mobi
  • webos
  • incognito
  • webmate

Option 4:

Feel free to wrap tags!

<txp:pro_mobile> Welcome mobile user! <txp:pro_if_mobile name="opera mini"> You use opera mini, great browser! </txp:pro_if_mobile> <txp:pro_if_mobile name="android"> You use android, great browser! </txp:pro_if_mobile> <txp:else /> // normal content </txp:pro_mobile>

You can do a lot with media queries in the head of your textpattern page, see this article for code examples on how to create mobile version of your site with media queries alone, however there will still always be times you want a custom message, such as a custom Ipad message with instructions on how to add that page to the home screen etc. But I would recommend a heavy reliance on media queries over device ‘sniffing’ for your overall tactic, do post any questions/feedback here too!

Contact us!

We would be delighted to hear from you.


Send your project details to hello@proximowebdesign.ie and we will get in touch!

Web Design Testimonials

Hilary at her Company Proximo Design created a webpage for me at Gourmet Burger Bistro this year. I wanted to get it up and running quickly and I could not have been more satisfied with the speed and quality of her results.
Best of luck in the future Hilary and I look forward to continuing our business relationship.
Michael Condon
Gourmet Burger Bistro

Michael Condon Owner, Gourmet Burger Bistro

“I worked with Hilary for a time and during that period I found her to be extremely helpful and articulate. Her work was of highest standard and I was also able to observe how she interacted with her clients. While providing a top class service she maintained friendly and helpful services with them, listened to what they wanted and made appropriate suggestions. Hilary also assisted me with my work and provides services to the local community at large. I have no hesitation in recommending Hilary for any work.”

Andrea Harte - Undergraduate at University of Limerick

“Hilary is quite an exceptional web designer and has a great eye for detail. After we gave her our concept from the outset she returned with an excellent offering. Superb designs, very efficient web design, best advice and we always got the feeling she was always looking after us. At every stage in dealing with her she has out done herself and truly is a gifted designer. Comes highly highly recommended by us and we have gotten huge praise from others we have referred to her. Keep up the excellent work Hilary.”

Owen Purcell - mybodyworks.ie

“Hilary is an experienced web designer who understands the most complex coding issues web designers can face. Very easy to work with and always meets her deadlines.”

Paul Feeney - printing.com

“Hilary is the most passionate, multi-talented web expert I know! She is totally committed to delivering the absolute best for her clients, and is a pleasure to work with and be around. Not only does Hilary deliver beautiful websites, they are also fully standards compliant, and use the most up-to-date technology. I would have no hesitation recommending Hilary and Proximo Web Design to anyone – and I often do!”

Lauren O'Donovan - Digital Strategist at Creative B'stro

We help you with Web Design. Online Marketing. SEO. Social Media. Content Creation.