[Zope] getting port number into URL - was where port num gone

Andy Heath a.k.heath@open.ac.uk
Mon, 13 Mar 2000 10:12:07 +0000


I'm sorry to ask this again but there must be a way of
getting a port number into a url without being explicit
about the address.  There has to be because absolute_url()
does it inside a tree.  I just don't know what I can use
and the expression syntax to do so.

I have this

root
    ltscimages
        someimage
    somefolder
        somedtlmdoc

and I'm running both apache and zope.  Some pages
get served zope-->apache and some direct from zope.
ZServer is running on 8080.

Within somedtmldoc I want an image from ltscimages.
This code

<dtml-var "ltscimages.someimage">

produces a reference
to the image but without the port number.

In the ouput html I want

http://host:8080/ltscimages/someimage

but I get

http://host/ltscimages/someimage

I can work around this by serving the image via
the zope-->apache method but that's crummy - I want
only to use apache when I have to because of the
efficiency effect.  Putting the port in explicity
is also crummy because its less transportable.

How can I either 1. always get the port num in
or  2. get the port in if its not
the default 80.

Elswhere in the same code absolute_url() does this correctly
for code inside a tree.  Would there be a way to use this here?

Sorry for so many newbie q's.  I promise I'll give back when I can.

Andy
-- 
-------------------------------------------------
Andy Heath                    a.k.heath@open.ac.uk
The Open University           +44 (0) 114 2885738