[Catalyst] Image serving

Andreas Marienborg omega at palle.net
Tue Jan 31 14:47:47 CET 2006


On 31. jan. 2006, at 14.23, Harold Frayman wrote:

> Andreas Marienborg" <omega at palle.net> wrote:
>> use the <base> html head tag?
>>
>> trough that you should be able to get it to reference relative urls
>> from where you want
>
> I must be missing something obvious but critical; I can change the  
> base (via the template) or intercept the call (via Regex('img'))  
> and alter the path there.
>
> But I cannot work out what the path _should_ be, or alternatively  
> (additionally?), how to persuade Catalyst to process the image path  
> and return the image to the browser.
>
Do you have Static::Simple loaded as a plugin? if so, it should be a  
matter of referencing the file regularly.

My thoughts was that if you have /Path/To/Documents/Path/Through/ 
Tree/ in $c->req->base, you can perhaps add Title in the controller,  
put it in the stash and set that as base in the templates.

Remember one thing: a url to catalyst doesnt necesarily make a path  
to a file. It has  no built in suppor for serving anything but stuff  
trough a view.

andreas

> Harold
>
>>
>> andreas
>> On 30. jan. 2006, at 23.30, <harold.frayman at ntlworld.com>
>> <harold.frayman at ntlworld.com> wrote:
>>
>>> I am using Catalyst to serve web pages from a document tree which
>>> already exists and cannot be changed significantly. The documents
>>> to be served are of the form
>>>
>>> /Path/To/Documents/Path/Through/Tree/Title/body.html
>>>
>>> A call to MyApp/help/Path/Through/Tree/Title serves the body.html
>>> text and wraps it in a page which includes links to, for example,
>>> Path, Through and Tree and to subfolders (/Path/To/Documents/Path/
>>> Through/Tree/Title/NextLevelTitle) which are handled by equivalent
>>> calls.
>>>
>>> At the moment, a file called body.html may link to "img/
>>> myimage.jpeg", in which case myimage.jpeg will be stored in /Path/
>>> To/Documents/Path/Through/Tree/Title/img.
>>>
>>> The result is that Catalyst looks for /help/Path/Through/Tree/img/
>>> myimage.jpeg. (The base is one level above the Title folder).
>>>
>>> I have tried various configurations of
>>> Catalyst::Plugin::Static::Simple and I have tried tried putting the
>>> image in several different places, but I cannot get the image to
>>> appear.
>>>
>>> Any suggestions? Even if I have to move the images, which I want to
>>> avoid?
>>>
>>> Harold
>
>
> -----------------------------------------
> Email sent from www.ntlworld.com
> Virus-checked using McAfee(R) Software
> Visit www.ntlworld.com/security for more information
>
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst




More information about the Catalyst mailing list