Re: FIXED: Re: [Zope] URL0 returns index_html not index.html
John Eikenberry wrote: Mark Barratt wrote: A text substitution covers both cases: tal:attributes="href python:context.REQUEST['URL0'].replace('index_html','index.html')+'/source.html'" Wouldn't this just result in "[path]/index.html/source.html"? Do you want the index.html in the URL to source.html. This will work with Zope but looks strange. Using URL1 instead of URL0 would leave the index[._]html off the generated URL. Only if the apparent address of the 'page' is [folder]/, and that is what I want. But it also works if the apparent address of the 'page' is pagename.html - in that case URL0 returns the correct complete path and the text substitution doesn't come into play. In all case I want to return /source.html of the target page so I can edit it in Mozile (not that I can yet, mind you). best -- Mark Barratt ___ 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 )
Re: FIXED: Re: [Zope] URL0 returns index_html not index.html
Mark Barratt wrote: > Well, no, because some of the objects I want to append /source.html to > are not called index.html (but that *is* how we did it for another site > and it works as you say). > > A text substitution covers both cases: > > tal:attributes="href > python:context.REQUEST['URL0'].replace('index_html','index.html')+'/source.html'" Wouldn't this just result in "[path]/index.html/source.html"? Do you want the index.html in the URL to source.html. This will work with Zope but looks strange. Using URL1 instead of URL0 would leave the index[._]html off the generated URL. > >If you were working with zope projects there are other tricks you could > >pull, but it doesn't sound like you are doing this. > > I don't understand this: is a 'zope project' different from my project > using zope? Opps. I meant a 'zope product', ie. a python based product. -- John Eikenberry [EMAIL PROTECTED] __ "A society that will trade a little liberty for a little order will deserve neither and lose both." --B. Franklin ___ 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 )
FIXED: Re: [Zope] URL0 returns index_html not index.html
John Eikenberry wrote: Mark Barratt wrote: I can vaguely see why this is happening. My question: is there a straightforward way of making the links (and error reports) return the actual page address? By actual page address you want the URL with index.html instead of index_html? Given your current setup as described, redirecting would work. Well, no, because some of the objects I want to append /source.html to are not called index.html (but that *is* how we did it for another site and it works as you say). A text substitution covers both cases: tal:attributes="href python:context.REQUEST['URL0'].replace('index_html','index.html')+'/source.html'" If you were working with zope projects there are other tricks you could pull, but it doesn't sound like you are doing this. I don't understand this: is a 'zope project' different from my project using zope? Thanks to you and Dieter for the help -- Mark Barratt ___ 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 )
Re: [Zope] URL0 returns index_html not index.html
Mark Barratt wrote at 2005-8-17 17:41 +0100: >Zope 2.7.4 on Debian > >DTML method index_html in the root says Do you know, that this is equivalent to the simpler ""? >A link in a page template to > >tal:attributes="href string:${context/REQUEST/URL0}/source.html > >where the page is addressed by [path]/ and is actually at [path]/index.html > >returns [path]/index_html/source.html Of course: The object located by URL traversal is "index_html" and not "index.html". When rendered, "index_html" happens to return the same text as "index,html", but this does not change "URL0". >I can vaguely see why this is happening. My question: is there a >straightforward way of making the links (and error reports) return the >actual page address? The most straight forward way would be to perform a redirect to "index.html" in your "index_html" -- not the most efficient way, but one with the least surprises... -- Dieter ___ 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 )
Re: [Zope] URL0 returns index_html not index.html
Mark Barratt wrote: > Zope 2.7.4 on Debian > > DTML method index_html in the root says > > A link in a page template to > > tal:attributes="href string:${context/REQUEST/URL0}/source.html URL0 always(?) includes the ending published object (eg. index_html). Normally if you don't want this you just use URL1. > where the page is addressed by [path]/ and is actually at [path]/index.html > > returns [path]/index_html/source.html Using URL1 you should get [path]/source.html which would seem to me to be what you want. > I can vaguely see why this is happening. My question: is there a > straightforward way of making the links (and error reports) return the > actual page address? By actual page address you want the URL with index.html instead of index_html? Given your current setup as described, redirecting would work. Though this would cause every hit on a page's index to tranverse twice. If the site isn't super high traffic it wouldn't be noticable. If you were working with zope projects there are other tricks you could pull, but it doesn't sound like you are doing this. > (I think I understand that 'actual' 'page' and 'address' are all > metaphors which may be leading me into error... ) In zope there is the URL which represents the object traversal and there is the returned content (html, images, etc). The returned content (maybe what you mean by actual page) can feasibly come from some other part of the site, a database, or just about anything else. The URL or address is just what method/object gets run to get said content. > Thanks for any help/enlightenment. Not sure if I'm making this much clearer. But there it is anyways. -- John Eikenberry [EMAIL PROTECTED] __ "A society that will trade a little liberty for a little order will deserve neither and lose both." --B. Franklin ___ 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 )