[Zope] Test for browser version using dtml-if?
Tino Wildenhain
tino@wildenhain.de
Thu, 03 Oct 2002 18:51:25 +0200
Hi Michael,
all the browser sends to the server you will find in the
REQUEST object.
If we speak DTML here (death to DTML anyway!),
you would make yourself a picture with
<dtml-var REQUEST> (IIRC)
If you look at the resulting page, you migt find something
like REQUEST.HTTP_USER_AGENT to look at.
All whats left is up to your needs - see any standard python
manual for substring search or pattern matching. Ooops. Forget
about the pattern matching, this is disabled for DTML and stuff.
Whatever you do, keep in mind: you never know whats really the browser.
Most browsers will fake the version string. If you want to make
something like "You dont have the right browser to look at our
bloated webpages, go away and load down ..." Then I come and
bash you personally ;)
If you like to make a browser specific help, say to explain a
user how to configure language settings for the specific Browser,
detecting the Browser version to present matching screenshots
is recommended.
Regards
Tino
--On Mittwoch, 2. Oktober 2002 15:19 -0600 Michael <michael@exasource.com>
wrote:
> Does anyone know how to test for browser version using <dtml-if>? I can
> do it with javascript, but was wondering if it is possible to just use
> an if statement?
>
> Michael
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )