AW: [opencms-dev] Text-only alternative for website howto
Kai Schliemann
k.schliemann at comundus.com
Mon Jan 23 15:47:55 CET 2006
Hi Joe,
we did this by using a different stylesheet (css). You can change the
Stylesheet with Javascript or - of course - jsp.
(You can find a working example on http://www.einfachfüralle.de/ (the page
is in german). On the right side menu choose from the "Stil") select box.
If you want to load a certain stylesheet for a certain browser
automatically, you can use a JS-, JSP- or CSS-based browser switch.
This works on the example page, too. If you use NS4, the "EFA print style"
css is loaded. This is done by a css switch.
I think this is the easier solution. Assuming that you are good at CSS
styling.
HTH
Kai
> -----Ursprüngliche Nachricht-----
> Von: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org]Im Auftrag von Joe Desbonnet
> Gesendet: Montag, 23. Januar 2006 01:41
> An: The OpenCms mailing list
> Betreff: [opencms-dev] Text-only alternative for website howto
>
>
> I've been researching the following problem and have come up with a
> solution. So I'm writing up a "Howto" document, but I would like to
> hear from others who may have solved the problem in a different
> (perhaps better) way first.
>
> The problem:
>
> All pages must include a "Text-only" link which will take the user to
> a version of the page rendered with a text-only template. This is to
> facilitate a small, but significant number of users who cannot or
> prefer not to use graphical browsers such as IE and Mozilla/Firefox.
> Once a user selects the "text-only" option, all subsequent pages in
> the user's session must be rendered using the text-only template until
> such time the user chooses to revert to the default (graphical)
> template.
>
> The solution:
>
> My first thought was to use cookies to remember the user's preference
> for text-only template. However this requires cookies to be enabled on
> the browser. Also I believe this approach is not compatible with the
> use of FlexCache. Ie choosing different templates depending on the
> value of a cookie is not possible while FlexCache is in operation
> because FlexCache can only cache one version of a page.
>
> My second idea was to use GET parameters. Eg to append
> "?template=text" to the end of all links and to check for the
> "template" parameter in the template code and render accordingly. The
> problem with this technique, is that all links (including those in
> HTML pages) would have to be changed on the fly to incorporate this
> parameter. This technique is compatible FlexCache, but as far as I
> can tell it is not trivial to implement.
>
> The solution I'm currently testing to create two VirtualHost entries
> in the Apache httpd.conf. (I am using Apache to serve the site as
> described in "Configure OpenCms, httpd and Tomact to serve multiple
> sites" in the OpenCms manual).
>
> The first entry is exactly as described in the manual, mapping
> http://www.mysite.com/ to the OpenCms site. The second entry is a
> duplicate of the first, except the host name
> is different. Eg it maps http://text.mysite.com/ to the same OpenCms
> site. Obviously DNS needs to be setup to map text.mysite.com to the
> Apache server.
>
> Now I modify my template code to check for HTTP header entry
> "x-forwarded-host"
> (mod_proxy copies the original "host" header into "x-forwarded-host").
> If the host name starts with "text." I render the page with the text
> template, else I render with the default template.
>
> I am currently testing this technique and it is looking promising.
> However I'd like to hear from anyone that might have a neater solution
> to his problem.
>
> Regards,
>
> Joe.
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list