[Zope] Re: . in Object ID (was Newbie dtml-var question (probably...))

Chris Withers chrisw@nipltd.com
Wed, 16 Feb 2000 12:11:59 +0000


> How about renaming niplogo.gif to niplogo and trying it that way
> (what you're trying to do when you do <dtml-var
> "PARENTS[-1].project.images.Niplogo.gif"> is get the attribute '.gif'
> from the object Niplogo). In other words, you need to get away from
> using the extension....

Unfortunately I have a hidden agenda here... While that would be fine for
images, I was wondering about using this technique to solve my other problem:

> 1. At home, URLs are something like localhost:8080/project/index.html
> 
> 2. At work, they are something like zope.nipltd.com/project/index.html
> 
> 3. And finally, the sites are often also presented as something like
> www.project.com.
> 
> The problem is how to phrase URLs in hrefs. <A HREF="/index.html"> does not 
> work for cases 1 and 2 as it goes to the root index.html on the server. 
> However, it is the only way I can think to do links that work for case 3.

I'm sure I read something about a getURL() method somewhere...

Anyway, why this causes extension problem is because objects other than images
may need to have extensions and may need to be referenced with HREF's in the
site. For example, downloadable Powerpoint presentations need to end in .ppt or
Windoze will not know how to open them when they're on the file system.
Also, I edit all my content pages with Dreamweaver (for PC) and so they need to
have .html extensions 'cos while Dreamweaver is very good for editing, it's too
stupid to use MIME types to recognise what type a file is...

Any ideas?

Chris

PS:
> I also found this;
> <dtml-var "yourimage.tag(border=0, alt='', width='', height='')">

Cool :-)