[Seaside] Making generated links more understandable

Lawrence Kellogg mac.hive at me.com
Tue Mar 27 16:09:19 UTC 2012


On Mar 27, 2012, at 11:28 AM, Nick Ager wrote:

> Sorry I wasn't clear. I don't recommend using the file libraries for deployment, you can use them during development then write the files contained within the file library out prior to deployment using:
> 
> MYFileLibrary default deployFiles.
> 
> These files can then be placed in a directory known to your font-end server such as Nginx and served by it. Of course their are plenty of other ways to develop such as using WAExternalFileLibrary found here: http://www.squeaksource.com/Seaside30LGPL,  or simply placing your files on an external file server such as Amazon S3
> 

  Ok, but I guess the question still remains why the addToPath: command messes up serving from my nginx directory, and is there any way around it. Is there some other way I can tag the url for Google analytics without adding a path component? 

  Larry




> Cheers
> 
> Nick 
> 
> 
> 
> On 27 March 2012 16:10, Lawrence Kellogg <mac.hive at me.com> wrote:
> 
> On Mar 27, 2012, at 11:00 AM, Nick Ager wrote:
> 
>>   I am also struggling to understand why everything breaks. My nginx.conf file redirects to /var/www/glass for files that I refer to in my code, so I only put 'picture.jpg' for an image, for instance, or 'bootstrap.css', and it all works great. Would you call that a relative path?
>> 
>>   If I put in that single addToPath line in updateUrl: 
>> 
>>> updateUrl: aUrl
>>> 	super updateUrl: aUrl.
>>> 	aUrl addToPath: self class name
>> 
>> 
>> So in your render methods do you have code that looks like:
>> 
>> html image url:  'picture.jpg'.
>> 
>> If so the request url will be relative to page path, which you are modifying by adding the class name.
>> I'd normally develop using a file library or external file library which would look like: 
>> 
>> html image url:  MyFileLibrary / #pictureJpg.
>> 
>> this generates html as: <img src='/files/MyFileLibrary/picture.jpg'>
>> 
>> which is always absolute from the root.
>> 
> 
>   Yes, I have html image tags as you describe. I have been told not to use the FileLibrary class for things like CSS, etc, because it gets cached somewhere where it shouldn't, 
> but I am forgetting the exact reason now. So, I don't use the FileLibrary for anything, in deployment, and I'm talking about my deployed system here. This code works correctly in my local system that uses a FileLibrary. 
> 
>> Have a look with the developer tools (firebug etc) to see what the request path is
>> 
> 
>   Thanks...
> 
>   Larry
> 
>> Cheers
>> 
>> Nick
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20120327/a68fabee/attachment-0001.htm


More information about the seaside mailing list