You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kjell Arne Brødreskift <ka...@web-som-virker.no> on 2005/02/25 11:43:14 UTC

How to extend and use the BrowserSelector

Hello all, this probably is a simple question with an obvious answer to
you, but I hope someone would take a little time and point me in the
right direction here.

I have read about and tried the excisting BrowserSelector in Cocoon, but
just getting the name of the browser isn't enough. Browsers also vary
with versions and platforms. What I want is to match on the user-agent
in the sitemap. And then use selectors to point each browser to the
right stylesheet.

And the question is: Is this the right way to go about this, and how can
you make this apply to every page on the site without interferring with
the rest of the sitemap?


Kjell Arne


Re: How to extend and use the BrowserSelector

Posted by Kjell Arne Brødreskift <ka...@web-som-virker.no>.
Thank you, I'll try that. There are so many ways of doing things in
Cocoon - it's good to know I'm on the right track.

Kjell Arne








On Fri, 2005-02-25 at 13:41 +0100, Askild Aaberg Olsen wrote:

> Kjell Arne Brødreskift wrote:
> 
> > Hello all, this probably is a simple question with an obvious answer 
> > to you, but I hope someone would take a little time and point me in 
> > the right direction here.
> >
> > I have read about and tried the excisting BrowserSelector in Cocoon, 
> > but just getting the name of the browser isn't enough. Browsers also 
> > vary with versions and platforms. What I want is to match on the 
> > user-agent in the sitemap. And then use selectors to point each 
> > browser to the right stylesheet.
> >
> > And the question is: Is this the right way to go about this, and how 
> > can you make this apply to every page on the site without interferring 
> > with the rest of the sitemap?
> >
> >
> > Kjell Arne
> >
> You should be able to configure this in the map:selectors/map:selector 
> part of the sitemap. The browserselector matches the *first* occurrence 
> in the <browser>-list where the useragent-attribute is contained within 
> the UserAgent-header field from the browser.
> 
> A clever set of values and ordering would accomplish this.
> 
> Another solution would be to use the HeaderSelector directly with the 
> UserAgent-field, or use flowscript.
> 
> Askild Aaberg Olsen
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

Re: How to extend and use the BrowserSelector

Posted by Askild Aaberg Olsen <as...@xangeli.com>.
Kjell Arne Brødreskift wrote:

> Hello all, this probably is a simple question with an obvious answer 
> to you, but I hope someone would take a little time and point me in 
> the right direction here.
>
> I have read about and tried the excisting BrowserSelector in Cocoon, 
> but just getting the name of the browser isn't enough. Browsers also 
> vary with versions and platforms. What I want is to match on the 
> user-agent in the sitemap. And then use selectors to point each 
> browser to the right stylesheet.
>
> And the question is: Is this the right way to go about this, and how 
> can you make this apply to every page on the site without interferring 
> with the rest of the sitemap?
>
>
> Kjell Arne
>
You should be able to configure this in the map:selectors/map:selector 
part of the sitemap. The browserselector matches the *first* occurrence 
in the <browser>-list where the useragent-attribute is contained within 
the UserAgent-header field from the browser.

A clever set of values and ordering would accomplish this.

Another solution would be to use the HeaderSelector directly with the 
UserAgent-field, or use flowscript.

Askild Aaberg Olsen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org