Re: Making a dynamic Style sheet, suggestions
Re: Making a dynamic Style sheet, suggestions
- Subject: Re: Making a dynamic Style sheet, suggestions
- From: jerry porter <email@hidden>
- Date: Mon, 6 Mar 2006 08:27:37 -0800 (PST)
Hi Amedeo,
I have created a series of components that can be found on wocode called CssMangler.
It consists of a number of components in an example project that will help I hope.
Give it a look. I have a newer version I need to post on wocode.
Jerry
--- Lachlan Deck <email@hidden> wrote:
> Hi there,
>
> On 20/02/2006, at 11:19 PM, Amedeo Mantica wrote:
>
> > Hello, I need to change same text colors and other site parts
> > depending on the section...
> >
> > I have done a webobject component that u use in partial mode and i
> > have putted inside it my css source code.... using WOString for
> > controlling parameters...
> >
> > like this:
> >
> > .leftMenu a:link, .leftMenu a:visited { color: <webobject
> > name="linkColor"></webobject>; background: <webobject
> > name="linkBgColor"></webobject>; } .leftMenu a:hover, .leftMenu
> > a:focus, .leftMenu a:active { background: white; color: <webobject
> > name="hoverColor"></webobject>;}
> >
> > then i put this in my page using WOSwitchComponent inside the page
> > header.
> > Works perfeclty, but seem to be dirty... there are other clean
> > solutions?
>
> The other option would be to create a CSSComponent accessed via
> direct actions. i.e.,
>
> Doing it this way, you'd want the effect to be like...
> <link rel=stylesheet type="text/css" href="/cgi-bin/WebObjects/wa/css?
> var1=blah&var2=wah">
>
> e.g.,
> --- YourComponent.html ---
> <html>
> <head>
> <webobject name="CSSElement"></webobject>
> ...
> </head>
>
> --- YourComponent.wod ---
> CSSElement: WOGenericElement {
> elementName = "link";
> rel = "stylesheet";
> type = "text/css";
> href = cssHref;
> }
>
> --- YourComponent.java ---
> public String cssHref() {
> NSMutableDictionary query;
>
> query = new NSMutableDictionary();
> ...
> return context().directActionURLForActionNamed("CSS/somecss", query);
> }
>
> with regards,
> --
>
> Lachlan Deck
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
Jerry Porter
Senior Software Engineer
Universal Measurement Solutions, Ltd.
Unit 90, 2150-29th Street NE
Calgary, Alberta
Canada T1Y 7G4
http://www.umsltd.com
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden