Hi; I want to simply_and_elegantly achieve the following: 1. Ping the visitor's browser to determine screen resolution (easy: I know how to capture this). 2. Redirect them to a folder such as 800 or 1024 depending on the res (easy again). 3. Assign a variable within that folder via a dtml method that will be used to size elements such as image width and height (easy again). 4. Place all the documents that will need that variable in a lower folder, so that I don't have to copy all the dtml documents into folders 800 and 1024 (ah: not so easy! at least not for me). The problem appears to be that I need to cull a variable out of a Javascript that I can in turn utilize in a dtml method.So, how do I do this? TIA, BenO
Ben Ocean wrote:
Hi; I want to simply_and_elegantly achieve the following:
1. Ping the visitor's browser to determine screen resolution (easy: I know how to capture this). 2. Redirect them to a folder such as 800 or 1024 depending on the res (easy again). 3. Assign a variable within that folder via a dtml method that will be used to size elements such as image width and height (easy again). 4. Place all the documents that will need that variable in a lower folder, so that I don't have to copy all the dtml documents into folders 800 and 1024 (ah: not so easy! at least not for me).
The problem appears to be that I need to cull a variable out of a Javascript that I can in turn utilize in a dtml method.So, how do I do this? TIA, BenO
Why don't you use a layout like / /folder_800 /folder_1024 /content And just acquire content in the right position i.e. folder_800/content/blabla => 800 optimized and folder_1024/content/blabla => 1024 optimzed where blabla's physical location is /content/blabla Now give folder_800, folder_1024 and content a int property, say "res". Then you only need javscript in your start page, the rest can be constructed solely in zope, without javascript, like <img src='fdf' width=<dtml-var "res/100">>. Additionally you can use the content folder for browsers without javascript. cheers, oliver
On Fri, Oct 26, 2001 at 08:01:59AM -0700, Ben Ocean wrote:
The problem appears to be that I need to cull a variable out of a Javascript that I can in turn utilize in a dtml method.So, how do I do this?
Untested ideas, which may not work at all: - Put all the screen-measuring logic into a splash screen, and have the user click on some page element to go to the real site. Use Javascript to make the <a href="foo"> tag that they click on. - Put the measuring logic into a much simpler splash screen, but with a Javascript-written refresh meta tag in the page header. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
participants (3)
-
Ben Ocean -
Mike Renfro -
Oliver Bleutgen