• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: using CSS with WO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using CSS with WO


  • Subject: Re: using CSS with WO
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Mon, 1 Aug 2005 14:26:17 -0400

On Aug 1, 2005, at 5:54 AM, email@hidden wrote:

Hi there,
I can not add CSS into project so that pages (components) could
link to it. So I had to put CSS file separately on web server and
make static link to it.


Seems like a reasonable approach.

It seems more reasonable to me to put css into resources folder


Not that I know of, but the basic options seem to be:
a) place them on the web-server and link to them as you have.
b) include in the "Web Server Resources" group:
Utilise the dynamic element WOResourceURL.


The problem is that link to css is located it html <head>, not in <body>.
I use WO Builder to add dynamic elements to <body> but how do i add them
to <head>?



Here is the approach that I would use if you've selected this option of the four suggested by LD:


First, I don't know of any way to use the WOBuilder Layout View to edit tags in the HTML page header. So use the little view pop-up in the far upper left corner of the WOBuilder window to switch the view to Source View and edit the .html and .wod files directly.

Do that first, then modify your css link tag to look something like the following:

     <link rel="stylesheet" type="text/css" href="">

Place the insertion bar between the two double quotes in the href="" attribute of the link tag. Then click on the "Add Custom WebObject" icon in the toolbar.

In the Custom WebObject panel that displays, select WOResourceULR from the pop-up menu. (You can select this more easily by typing in the first few characters in the pop-up field to get near the WOResourceULR selection.) Give your new WebObject tag a name (such as StylesFile) and it will insert the new tag in your .html file at the insertion bar and the corresponding tag definition in your .wod file. Your link tag should now look something like this:

<link rel="stylesheet" type="text/css" href="<WEBOBJECT NAME=StylesFile></WEBOBJECT>">

Then edit the tag definition in the .wod file to look something like this:

    StylesFile: WOResourceURL {
        filename = "styles.css";
    }

where "styles.css" is the name of the .css file in your Web Server Resources group.

Save the newly modified WOComponent.

Be very careful of your use of quote marks (look carefully at the example above), be sure that your .css file is in the Web Server Resources group when you run and you shouldn't have any problems.

Good luck,
Jerry

--
__ Jerry W. Walker, Partner
C o d e F a b, LLC - "High Performance Industrial Strength Internet Enabled Systems"
email@hidden
212 465 8484 X-102 office
212 465 9178 fax



_______________________________________________ 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
References: 
 >Re: using CSS with WO (From: email@hidden)

  • Prev by Date: Re: Tomcat build & deployment idiot's guide needed
  • Next by Date: Re: Deployment with 5.3?
  • Previous by thread: Re: using CSS with WO
  • Next by thread: Building FrameWork
  • Index(es):
    • Date
    • Thread