Re: Silva 2.2 Layot: How to

Sylvain Viollon <[email protected]> Tue, 1 Jun 2010 18:02:55 +0200
Newsgroups gmane.comp.web.zope.silva.devel
Organization Infrae
Message-ID <[email protected]>
On Tue, 1 Jun 2010 17:40:52 +0200
"Luthiger Stoll  Benno" <[email protected]> wrote:

> Hello all
> 
  Hello,

> I'd like to develop a layout using Silva 2.2.

  Great !

> Unfortunately, I stumble over the task to display an image on the
> page. The image is my_layout/static/my_image.gif.
> What's the html code in the page template to display this image?
> 
> I've tried the following:
> <div tal:define="resourcebase request/resourcebase/absolute_url;">
>   <img tal:attributes="src
> string:${resourcebase}/++resource++my_layout/my_image.gif" />
> </div>
> 

  <img tal:attributes="src layout/static/my_image.gif" />

  Should work (to test) and would be the optimum (you can traverse on
  view and layout to static, and locate a resource in it. triggering
  __call__ on it will give you back the URL to the resource).

> PS: The documentation on http://docs.infrae.com/silva/layout/ is not
> of much use in this case.
> I have the impression, it contains some misleading mistakes.
> 

  The document is not complete that's why, work is still required on it
  (like on many things).


  Regards,

  Sylvain,
  


-- 
Sylvain Viollon -- Infrae
t +31 10 243 7051 -- http://infrae.com
Hoevestraat 10 3033GC Rotterdam -- The Netherlands