• 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: Static Images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static Images


  • Subject: Re: Static Images
  • From: Marek Wawrzyczny <email@hidden>
  • Date: Wed, 25 Jun 2003 13:33:47 +1000

On Wednesday, Jun 25, 2003, at 04:39 Australia/Sydney, Goodbye Bill wrote:

1. If I add a static image to the page, what should the relative URL be to
the image? This should be the same for everyone using WebObjects.

Your image source tags should be:

<IMG SRC="/Images/myimage.gif">

The image itself will no longer be displayed by WebObjects Builder, instead you'll see <IMG> objects.

2. If resources must be added to the project, where and how should they be
added?

We tend to keep static stuff (images, scripts, etc.) in a static folder inside the project directory. We do not add the static stuff to the project itself. As far as WebObjects is concerned, it does not need to know about them. The downside is that WebObjects Builder does not display the images. But that is ok with us we only use it for WebObjects logic. We know what the img tags are. We also tend to edit the html with GoLive to tidy it up.


3. Do I have to use a control for each image or should WebObjects notice the
"img" tag and convert the "src" property?

You do no have to do that. WebObjects does not process anything other than the <WEBOBJECTS> tags. Anything else on the page is simply included in the generated pages.


LOGIC:

I have an existing site that was built outside of WebObjects. It uses a lot
of images within each page but some elements of each page are dynamic. I am
porting it to WebObjects (obviously). I would like to use the images on the
page without having to convert every single image to a WOImage control.

That's good, you do not want WO to serve out these images.

STEPS SO FAR:

A. I have added ALL images to my project, under "Web Server Resources," as
well as a static copy on the sever. Here are the paths to the images:


    Physically on my hard drive:
    /Users/<userdir>/Projects/MyApp/Images

    In Project Builder:
    MyApp/Web Server Resources/Images
    (the directory and contents are all set to the Web Server target)

Unnecessary.

    Physically on my server's hard drive:
    /Library/WebServer/Documents/Images

    The location of the web server's root directory:
    /Library/WebServer/Documents

B. I have attempted to add a static image to my page. I have done this by:

    i. Opening a new page and adding a WOImage to the page;

ii. In the inspector, click the "Make Static" button for the WOImage;

iii. In the inspector, select "Doc Relative" for the image.

OK... What you should do at this point, just type the location of the image in the source field. So for the image below just type /Images/myimage.gif. You shouldn't have to worry about setting "Doc Relative" at this point. In fact, I believe it will incorrectly set the source to ../Images/myimage.gif - a bug in WO Builder.


    AT THIS POINT:
    1. The resulting page shows the following image now in the page:

        <IMG SRC="../Images/myimage.gif">

2. The image IS visible within Project Builder.

You will no longer see the image here.

3. The image is NOT visible when doing a "Build and Debug." The URL
to the image still shows the same relative path as above.

You should now see the image here.

Hope this helps.


Marek Wawrzyczny

software engineer
-------------------------->
ish group pty ltd
7 Darghan St Glebe 2037 Australia
phone +61 2 9660 1400   fax +61 2 9660 7400
http www.ish.com.au | email email@hidden
_______________________________________________
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.

References: 
 >Re: Static Images (From: Goodbye Bill <email@hidden>)

  • Prev by Date: Re: Globally Unique IDs
  • Next by Date: Re: Globally Unique IDs
  • Previous by thread: Re: Static Images
  • Next by thread: Re: Static Images
  • Index(es):
    • Date
    • Thread