Thanks Anthony!
Is it possible to set a request variable without URL args (to store in the
session)? I don't want the URL on the redirected desktop page to have a
'?mobile=false' attached. Is it bad practice to use a form with a fixed
value to send request variables, as opposed to a link with URL args?
On Saturday, August 25, 2012 5:20:25 PM UTC-7, Anthony wrote:
>
> I don't think you can control that using the @mobilize decorator, but
> instead of using the decorator, you can use request.user_agent().is_mobile
> to detect mobile clients and make changes accordingly. The @mobilize
> decorator just does this:
>
> user_agent = request.user_agent()
> if user_agent.is_mobile:
> items = response.view.split('.')
> items.insert(-1,'mobile')
> response.view = '.'.join(items)
>
> You could add that logic yourself to a model file, but make it conditional
> so it isn't executed if the user has selected the desktop version (that
> choice can be stored in the session).
>
> Anthony
>
> On Saturday, August 25, 2012 8:04:57 PM UTC-4, Mark Li wrote:
>>
>> I would like to add the option to visit the regular version of the site
>> on the mobile-view.
>>
>> However, from my understanding of @mobilize, it automatically redirects
>> to the mobile version of the page if a mobile device is detected. Is there
>> a way to override this behavior if a visitor on a mobile-device chooses the
>> Non-mobile option for the site?
>>
>
--