inserting images with Seaside

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

inserting images with Seaside

Thomas Keller-3
Greetings,
I'm working through the excellent tutorial by David Shafer (http://www.shaffer-consulting.com/david/Seaside/)
but I can't figure out how to get my images and other static (non-squeak) stuff to be found.
I have a directory named "Resources" in the same directory as my image file. I started the server with the following:
"Kill all existing Kom HTTP servers"
HttpService allInstancesDo: [ :each | each stop. each unregister ].

"Start a new server o port 9090 serving both static content and seaside apps"
| ma seaside |
seaside _ WAKom default.
ma _ ModuleAssembly core.
ma serverRoot: (FileDirectory default directoryNamed: 'Resources') fullName.
ma alias: '/seaside' to: [ma addPlug: [ :request | seaside process: request]].
ma documentRoot: (FileDirectory default directoryNamed: 'Resources') fullName.
ma directoryIndex: 'index.html'.
ma serveFiles.
(HttpService startOn: 9090 named: 'httpd') plug: ma rootModule


in my renderContentOn: html definition I enter the following:
html image: 'Resources/images.jpg' altText: 'Cybele-photo01.jpg'.

The Seaside component renders fine, but the image in Resources gives the message:
Error: "/seaside/Resources/images.jpg" not found

What am I doing wrong?

--
Tom
"Ecrasez l'Infame!" -- Voltaire
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: inserting images with Seaside

cdavidshaffer
Thomas Keller wrote:

> [snip]
>
>
> in my renderContentOn: html definition I enter the following:
> html image: 'Resources/images.jpg' altText: 'Cybele-photo01.jpg'.


Since you specified the Resources directory as the your file root (in
your server startup code) you don't need it it.  The file name
(Cybele-photo01.jpg) doesn't belong in the alttext part of the tag.
Also, do you have a directory called images.jpg in your Resources
directory?  Here's what I think you want but it depends on what your
directory structure is below Resources:

html image: 'images.jpg/Cybele-photo01.jpg' altText: 'Photo of Cybele'

Hope that helps...

David

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: inserting images with Seaside

Thomas Keller-3
Thanks for your help. But I'm still confused about the directory tree being used. My files are in this hierarchy:
- MySqueak (dir)
    - Squeak3.8-TJK.image
    - Resources (dir)
        - Cybele-photo01.jpg

What I understand your message to mean is that the documentRoot object contains static files that I can render without additional path information. So an image in Resources should render just by giving its filename. So I tried
html image: 'Cybele-photo01.jpg' altText: 'Cybele photo'.
This gives
Error: "/seaside/Cybele-photo01.jpg" not found.

Since that didn't render the image, I tried:
html image: 'Resources/Cybele- photo01.jpg' altText: 'Cybele photo'.
But also gives the not found error.
Error: "/seaside/Resources/Cybele-photo01.jpg" not found.

So at this point I'm stumped. I'm sure it's a trivial config issue. I'll keep working through the tutorial.

Thanks again.
Tom Keller

Also, the a
On 7/22/06, David Shaffer <[hidden email]> wrote:
Thomas Keller wrote:

> [snip]
>
>
> in my renderContentOn: html definition I enter the following:
> html image: 'Resources/images.jpg' altText: 'Cybele-photo01.jpg'.


Since you specified the Resources directory as the your file root (in
your server startup code) you don't need it it.  The file name
(Cybele-photo01.jpg) doesn't belong in the alttext part of the tag.
Also, do you have a directory called images.jpg in your Resources
directory?  Here's what I think you want but it depends on what your
directory structure is below Resources:

html image: 'images.jpg/Cybele-photo01.jpg' altText: 'Photo of Cybele'

Hope that helps...

David

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners



--
Tom
"Ecrasez l'Infame!" -- Voltaire
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: inserting images with Seaside

Thomas Keller-3
David,
I figured it out, thanks to your deduction that it was a path problem. But since I'd set '/seaside' as an alias, I had to give '../photo.jpg' as the path I.e., I had to direct the browser to look in the document Root not the aliased path to my image with the ../ relative path prefix. Anyway, thanks for your help.

Tom Keller

On 7/24/06, Thomas Keller <[hidden email]> wrote:
Thanks for your help. But I'm still confused about the directory tree being used. My files are in this hierarchy:
- MySqueak (dir)
    - Squeak3.8-TJK.image
    - Resources (dir)
        - Cybele-photo01.jpg

What I understand your message to mean is that the documentRoot object contains static files that I can render without additional path information. So an image in Resources should render just by giving its filename. So I tried
html image: 'Cybele-photo01.jpg' altText: 'Cybele photo'.
This gives
Error: "/seaside/Cybele-photo01.jpg" not found.

Since that didn't render the image, I tried:
html image: 'Resources/Cybele- photo01.jpg' altText: 'Cybele photo'.
But also gives the not found error.
Error: "/seaside/Resources/Cybele-photo01.jpg" not found.

So at this point I'm stumped. I'm sure it's a trivial config issue. I'll keep working through the tutorial.

Thanks again.
Tom Keller

Also, the a

On 7/22/06, David Shaffer <[hidden email]> wrote:
Thomas Keller wrote:

> [snip]
>
>
> in my renderContentOn: html definition I enter the following:
> html image: 'Resources/images.jpg' altText: 'Cybele-photo01.jpg'.


Since you specified the Resources directory as the your file root (in
your server startup code) you don't need it it.  The file name
(Cybele-photo01.jpg) doesn't belong in the alttext part of the tag.
Also, do you have a directory called images.jpg in your Resources
directory?  Here's what I think you want but it depends on what your
directory structure is below Resources:

html image: 'images.jpg/Cybele-photo01.jpg' altText: 'Photo of Cybele'

Hope that helps...

David

_______________________________________________
Beginners mailing list
[hidden email]
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" title="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://lists.squeakfoundation.org/mailman/listinfo/beginners



--
Tom
"Ecrasez l'Infame!" -- Voltaire



--
Tom
"Ecrasez l'Infame!" -- Voltaire
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners