Hi, use Link is <a href="/AFolder/">link here</a> instead of Link is <a href="AFolder/">link here</a> Jens ----- Original Message ----- From: honey bee To: zope@zope.org Sent: Saturday, March 09, 2002 12:04 PM Subject: [Zope] infobar and urls HI, I face a problem in using href tags in zope.I am using an Infobar from which I normally get all items and display them as links.but I decided to restrict the links displayed by adding an infobar_dtml method within the folder. Now the problem is that the link works but the URL keeps building up like this. Link is <a href="AFolder/">link here</a> each time I click on the link url adds "AFolder/" to itself.So it keeps growing with each click http://hostname:0000/AFolder/ http://hostname:0000/AFolder/AFolder/ http://hostname:0000/AFolder/AFolder/AFolder/ http://hostname:0000/AFolder/AFolder/AFolder/AFolder I was told that this is a bug in zope.But is there no workaround for this? please help.It looks ugly on my application :( Thanks and REgards ------------------------------------------------------------------------------ MSN Photos is the easiest way to share and print your photos: Click Here _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Sat, 9 Mar 2002, Jens Grewen wrote:
Hi,
use Link is <a href="/AFolder/">link here</a>
instead of
Link is <a href="AFolder/">link here</a>
Jens
Assuming your item is in the root folder, of course. ;-) You can also use <a href="<dtml-var "AFolder.absolute_url()" url_quote>">link here</a>, which will find the correct URL for AFolder and put it in. The nice thing about this is that you can move AFolder around in the hierarchy, but as long as the current method can find it through acquisition, it will work. -- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant
Joel Burton wrote:
On Sat, 9 Mar 2002, Jens Grewen wrote:
Hi,
use Link is <a href="/AFolder/">link here</a>
instead of
Link is <a href="AFolder/">link here</a>
Jens
Assuming your item is in the root folder, of course. ;-)
You can also use <a href="<dtml-var "AFolder.absolute_url()" url_quote>">link here</a>, which will find the correct URL for AFolder and put it in. The nice thing about this is that you can move AFolder around in the hierarchy, but as long as the current method can find it through acquisition, it will work.
Or yet another variation: <a href="&dtml.url-AFolder;">link here</a> Does what Joel's does, except that it is shorter, possibly more easy to read.
On Sat, 9 Mar 2002, Paul Erickson wrote:
Joel Burton wrote:
On Sat, 9 Mar 2002, Jens Grewen wrote:
Hi,
use Link is <a href="/AFolder/">link here</a>
instead of
Link is <a href="AFolder/">link here</a>
Jens
Assuming your item is in the root folder, of course. ;-)
You can also use <a href="<dtml-var "AFolder.absolute_url()" url_quote>">link here</a>, which will find the correct URL for AFolder and put it in. The nice thing about this is that you can move AFolder around in the hierarchy, but as long as the current method can find it through acquisition, it will work.
Or yet another variation:
<a href="&dtml.url-AFolder;">link here</a>
Does what Joel's does, except that it is shorter, possibly more easy to read.
Err, yeah, but for some reason, I thought that absolute_url() was safer for certain kinds of objects. Or am I making this up in my memory? -- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant
Joel Burton wrote:
On Sat, 9 Mar 2002, Paul Erickson wrote:
Joel Burton wrote:
On Sat, 9 Mar 2002, Jens Grewen wrote:
Hi,
use Link is <a href="/AFolder/">link here</a>
instead of
Link is <a href="AFolder/">link here</a>
Jens
Assuming your item is in the root folder, of course. ;-)
You can also use <a href="<dtml-var "AFolder.absolute_url()" url_quote>">link here</a>, which will find the correct URL for AFolder and put it in. The nice thing about this is that you can move AFolder around in the hierarchy, but as long as the current method can find it through acquisition, it will work.
Or yet another variation:
<a href="&dtml.url-AFolder;">link here</a>
Does what Joel's does, except that it is shorter, possibly more easy to read.
Err, yeah, but for some reason, I thought that absolute_url() was safer for certain kinds of objects. Or am I making this up in my memory?
Now you've got me curious... Th e documentation - http://www.zope.org/Members/AlexR/EntitySyntax says that using &dtml.url actually calls the absolute_url() method. Your's could be safer though, since it uses url_quote, although hopefully no object id's contain characters that are illegal in url's.
You can also use <a href="<dtml-var "AFolder.absolute_url()" url_quote>">link here</a>, which will find the correct URL for
Uhm... just rember to use this syntax: <a href="<dtml-var 'AFolder.absolute_url()' url_quote>">link here</a> since if you use double quotes in the internal part the parser can't distinguish when the 'href' part of the tag starts and ends. Alex
On Sun, 10 Mar 2002, Alex Cordero wrote:
You can also use <a href="<dtml-var "AFolder.absolute_url()" url_quote>">link here</a>, which will find the correct URL for
Uhm... just rember to use this syntax:
<a href="<dtml-var 'AFolder.absolute_url()' url_quote>">link here</a>
since if you use double quotes in the internal part the parser can't distinguish when the 'href' part of the tag starts and ends.
? Maybe _your_ Zope parser can't, but _mine_ can (2.5.0, and have done this as far back as 2.3.x). Perhaps the single-qoute-outside, double-quote-inside is more readable, but the both-double doesn't cause any problems that I can see. In any event, as has been pointed out, <a href="&dtml.url-AFolder"> is probably the easiest option. But, as always, TMTOWTDI. :-) -- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant
participants (5)
-
Alex Cordero -
honey bee -
Jens Grewen -
Joel Burton -
Paul Erickson