[Seaside] static resources and urls

Nevin Pratt nevin@smalltalkpro.com
Sat, 04 May 2002 10:10:55 -0600


Avi Bryant wrote:

>After Nevin's struggles to move his Dreamweaver templates into Seaside,
>I've been thinking a bit about static resources.  The problem is that you
>really want to have both of these properties:
>
>1. Relative paths in the urls of <img> src attributes, etc.  Templates
>should not have hardcoded paths in them, obviously, and the hacks
>involving dynamically inserting a prefix seem to be confusing and
>problematic
>

I got around my problem by writing code that preprocesses the 
Dreamweaver html file.  It changes the relative paths (as long as they 
don't start with '@') for my images into absolute paths based on the 
current doc root.  The result is the same as if the Dreamweaver person 
used absolute paths all along when he (my son, in this case) generated 
the html file.

>Right now, a typical URL
>looks like
>
>/seaside/config/uNH6GCyDqrpA6Wlf/top/1/view
>
>however, what issues would arise if that changed to
>
>/seaside/config/view?session=uNH6GCyDqrpA6Wlf&txn=top&page=1
>
>?
>
>Apart from some necessary massaging of Seaside's internals, I don't see
>anything wrong with making such a change, and it would easily allow some
>kind of 'resource/foo.jpg' scheme.  Does anyone else have any comments or
>caveats?
>


My initial reaction is "good change".

Nevin