Advanced Template Manager

Set template by User Agent string

5 months 1 day ago #77017

Beany's Avatar Beany

Can Template manager be used to load a template based on a unique user-agent string?
The idea here is that, if we build a webview-based mobile app, we want to be able to show a different template from the full responsive mobile site.
The webview app will have limited/reduced functionality, which we don't want for the full mobile site.
As we are building the app ourselves, we can insert a unique User agent string in the header of the app through webView.getSettings().setUserAgentString(My_App_name)
So we will have a fully responsive desktop and mobile website (using template A) and a Mobile App (using template B)

5 months 1 day ago #77018

Peter van Westen's Avatar Peter van Westen Admin

Thereis a ready-to-use Device assignment you can use in Advanced Template Manager.
This is based on the User Agent string.

5 months 1 day ago #77023

Beany's Avatar Beany

The Device Assignment in Advanced Template Manager is limited to the pre-defined Desktop, Mobile and Tablet.
I want to assign a template based on my own User Agent string sent by my app header
eg The App UserAgent will look like "Mozilla/5.0 (Linux; Android 4.4.4; One Build/KTU84L.H4) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36 [My_Mobile_APP/v2.0]"

I need to assign the Template based on [My_Mobile_APP/v2.0] which is exclusive to my app.
Its not Desktop, Phone or Tablet but a 4th User Agent

5 months 22 hours ago #77024

Peter van Westen's Avatar Peter van Westen Admin

You can use the Custom PHP assignment in Advanced Template Manager Pro to assign it to whatever you want.