[Zope-CMF] Redirection of mobile users

chad nantais tribewave@hotmail.com
Fri, 03 Jan 2003 17:25:03 -0500


It is not working, as per your instructions below.  I am testing the 
changeSkin() function alone and i get this:

  AttributeError: changeSkin

Here's the test (Python)script, located at the root of my CMF site, and set 
as an Access rule:

  context.changeSkin('Mobile')

I'm using:
Zope 2.6.0 (binary release, python 2.1, linux2-x86), python 2.1.3, linux2) 
ZServer/1.1b1'

CMF 1.3

Thanks for the help.  If I can get over this one hump with the changeSkin() 
method, it's be sweet.  Help is appreciated.

Chad



>From: sean.upton@uniontrib.com
>To: tribewave@hotmail.com, zope-cmf@zope.org
>Subject: RE: [Zope-CMF] Redirection of mobile users
>Date: Fri, 03 Jan 2003 09:11:45 -0800
>
>Have you considered something similar to the toggleSkin recipe on zopelabs?
>This uses hostname as a determiner of the skin that it loaded.  However,
>there is nothing (I don't think at least) that says you can't use useragent
>in an access rule script similarly...
>
>http://www.zopelabs.com/cookbook/1028172355 is the recipe.  There is a
>typo/bug in the last line of the code, the last comment on the page
>addresses this (changeSkin() takes the name of the skin, not the request
>object)...
>
>Good luck.
>
>Sean
>
>-----Original Message-----
>From: chad nantais [mailto:tribewave@hotmail.com]
>Sent: Friday, January 03, 2003 1:59 AM
>To: zope-cmf@zope.org
>Subject: [Zope-CMF] Redirection of mobile users
>
>
>I want to perform redirection of mobile users to a 'Mobile' skin that is
>stripped down.
>
>I want this function to be performed before any object in my portal is
>called, in case a mobile user calls an object like an article.
>
>I am going to use this bit of python in my main_template skin to detect if
>the user is a non-PC user:
>   python:request.HTTP_USER_AGENT[:7]!='Mozilla'
>
>Any suggestions on how to have the skin change to 'Mobile' if the above
>condition is met, before the page fully loads in its generic skin?
>
>Thanks,
>
>Chad Nantais
>
>
>_________________________________________________________________
>The new MSN 8: smart spam protection and 2 months FREE*
>http://join.msn.com/?page=features/junkmail
>
>
>_______________________________________________
>Zope-CMF maillist  -  Zope-CMF@zope.org
>http://lists.zope.org/mailman/listinfo/zope-cmf
>
>See http://collector.zope.org/CMF for bug reports and feature requests


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail