[Zope] Obtaining URL of Object w/Non-Var Name

Brian Lloyd Brian@digicool.com
Fri, 29 Oct 1999 13:37:59 -0400


Jeff, 

try this and let me know if it does the trick:

<dtml-var "_.getattr(this(), 'site.css').absolute_url()">



Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com 



> Alright, what's the trick to be able to retrieve the URL of a 
> Zope object
> via DTML whose id has blanks or punctuation in it?  For example,
> in a normally-named object called 'site_css', I'd do:
> 
> Ex. 1
>     <LINK REL=stylesheet HREF=<dtml-var 
> "site_css.absolute_url()"> TYPE="text/css">
> 
> But if the object is named 'site.css', I can use it w/o 
> another layer/call or escape code.
> I tried the following (and a lot of others) and the _[] 
> expression is returning a string,
> which then fails when it lacks a 'absolute_url' attribute:
> 
> Ex. 2
>     <LINK REL=stylesheet HREF=<dtml-var 
> "_['site.css'].absolute_url()"> TYPE="text/css"> 
> 
> Any solution must work with acquisition, as example one does, 
> so I can keep
> the stylesheet in the site root folder.
> 
> -Jeff Rush
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (Related lists - please, no cross posts or HTML encoding!
> 
> To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
> 
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )
>