Re: [Zope] anyone? Help getting the correct URL from absolute_url or portal_url
I found no reference to base href in the document. I don't set it and I don't see that ZOPE/CMF sets it either. here's the ZPT code that's generating the urls for the items <ul> <li tal:repeat="item items"> <a href="item_url" tal:attributes="href item/absolute_url"><img align="middle" border="0" tal:attributes="src string:${item/portal_url}/${item/getIcon}; alt string:${item/Type}; title string:${item/Type}"></a> <a href="item_url" tal:attributes="href item/absolute_url; title item/Description" tal:content="item/Title"> Title </a> </li> </ul> both absolute_url and portal_url when called within the frameset appear to get a reference to the parent frameset's host instead of the document's host. Are there other mechanisms in place to get the host name:port for a document?
From: J Cameron Cooper <jccooper@jcameroncooper.com> To: zope@zope.org Subject: Re: [Zope] anyone? Help getting the correct URL from absolute_url or portal_url Date: Fri, 14 Mar 2003 14:19:30 -0600
Yes we have done this purposefully.
I was just making sure that you weren't having a problem where it was mysteriously switching ports (which would be really bizarre.)
The main app is served from Silverstream java appserver (soon to be transitioned to Websphere :) ). All of our reference content is in ZOPE. It's an internal web application so users are limited in bookmarking (security/HIPAA issues) and the other reasons that frames don't make sense for the general web populace don't factor in for us.
You got me. I won't try to talk you out of frames, then.
We have multiple instances of ZOPE running so unfortunately I can't hard code any urls. I have to rely on the CMF and ZOPE to return the correct path for images and items via the absolute_url property or whatever property will give the correct url.
That's what I meant, actually. What method are you using to construct your URLs, how does it render, and where does it actually point? (Mozilla/Netscape's View Info should be helpful in this.)
I suspect that a proper base tag will let you use relative URLs correctly, unless your browser/browsers in general don't work this way. (I really can't speak as to how that works in frames.) In which case, you'll have to generate port-containing URLs from Zope.
--jcc
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
I found no reference to base href in the document. I don't set it and I don't see that ZOPE/CMF sets it either.
Zope should insert it if it isn't there and the page is recognized as HTML. Or al least, so says the source. Perhaps you should try to set it. I think REQUEST.URL1 or absolute_url should work for a value. Check the HTML source of zope.org to see one.
here's the ZPT code that's generating the urls for the items
<ul> <li tal:repeat="item items"> <a href="item_url" tal:attributes="href item/absolute_url"><img align="middle" border="0" tal:attributes="src string:${item/portal_url}/${item/getIcon}; alt string:${item/Type}; title string:${item/Type}"></a> <a href="item_url" tal:attributes="href item/absolute_url; title item/Description" tal:content="item/Title"> Title </a> </li> </ul>
both absolute_url and portal_url when called within the frameset appear to get a reference to the parent frameset's host instead of the document's host. Are there other mechanisms in place to get the host name:port for a document?
I'm pretty sure those should work with ports. How does this render? --jcc
participants (2)
-
J Cameron Cooper -
Michael Havard