Re: A want to add cascading style sheets to my WebObjects HTML Application
Re: A want to add cascading style sheets to my WebObjects HTML Application
- Subject: Re: A want to add cascading style sheets to my WebObjects HTML Application
- From: Kaj Hejer <email@hidden>
- Date: Sat, 30 Nov 2002 10:51:43 +0100
At 20:29 -0500 29-11-02, Thomas Peters wrote:
>HI All,
>
>A want to add cascading style sheets to my WebObjects HTML Application.
>
>I added my 'style.css' file to my project but the application can not find the
>file and I get a FileNotFoundException when I add the <LINK.. tag to my
>WebObjects component HTML page.
>
Hi!
One way of doing this is to add a WOGenericElement inside <head></head> of
your document wnd define this WOGenericElement as
cssLinkGeneric: WOGenericElement {
href = cssLink;
rel = "stylesheet";
elementName = "link";
}
To make it easier to insert this tag you might want to turn on "top level
tags" in WOBuilder->Preferences->Layout.
Then you create a method that gives you the url for the css:
public String cssLink() {
WOResourceManager rm = getApplication().resourceManager();
String url =
rm.urlForResourceNamed("medark.css", null, null,
context().request());
return url;
}
Here this css-file in the project is named "medark.css". You have to add
this file to Web Server Resources in ProjectBuilder.
-Kaj :)
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.