Hi all. I am using a keyword index as per the excellent howto. I use the following snippet to list the keywords as a series of links to further searches. (this is the objects index_html) related topics: <dtml-in keywords> <a href="search?key=<dtml-var sequence-item>"><dtml-var sequence-item></a><br> </dtml-in> This works fantastic if you are using IE or a keyword is just one word. Netscape does not seem to do anything intelligent if it is a key phrase instead and returns an error. Below are examples of the resolved urls it is trying to load IE .../search?key=direct%20access Netscape .../search?key=direct access Explorer pads out with the %20 - netscape does not - in fact netscape only works if a + appears instead. Netscape and Explorer add the + if a form field is used instead (similar to that at the top of the zope site etc) So my question to the gurus is is there an attribute or expression I can use to get round this? How can I specify that the two (or more) words in a keyword phrase are separated by pluses when the link is generated? yours in hope Jonathan
Jonathan Cheyne wrote:
So my question to the gurus is is there an attribute or expression I can use to get round this? How can I specify that the two (or more) words in a keyword phrase are separated by pluses when the link is generated?
Try this:
<dtml-in keywords> <a href="search?key=<dtml-var sequence-item url_quote>"><dtml-var sequence-item></a><br> </dtml-in>
Or this:
<dtml-in keywords> <a href="search?key=<dtml-var sequence-item url_quote_plus>"><dtml-var sequence-item></a><br> </dtml-in>
cheers, Chris (who's also in the UK, despite the email address ;-)
So my question to the gurus is is there an attribute or expression I can use to get round this? How can I specify that the two (or more) words in a keyword phrase are separated by pluses when the link is generated?
... embarrassing to work it out only a minute after sending in a query url_quote_plus seems to be exactly where i needed to be ... sorry for the bandwidth J
<dtml-in keywords> <a href="search?key=<dtml-var sequence-item>"><dtml-var sequence-item></a><br> </dtml-in>
This works fantastic if you are using IE or a keyword is just one word. Netscape does not seem to do anything intelligent if it is a key phrase instead and returns an error. Below are examples of the resolved urls it is trying to load
IE .../search?key=direct%20access Netscape .../search?key=direct access
Explorer pads out with the %20 - netscape does not - in fact netscape only works if a + appears instead. Netscape and Explorer add the + if a form field is used instead (similar to that at the top of the zope site etc)
So my question to the gurus is is there an attribute or expression I can use to get round this? How can I specify that the two (or more) words in a keyword phrase are separated by pluses when the link is generated?
Use `url_quote' attribute: <a href="search?key=<dtml-var sequence-item url_quote>"> PM
participants (3)
-
Chris Withers -
Jonathan Cheyne -
Marcel Preda