[Zope] How to get Query string in bold

Paul Zwarts paz@oratrix.com
Mon, 29 Oct 2001 16:19:27 +0100


Hi,

This is probably the clunkiest most primitive way to do it, but you
could use string.replace.. I have just tested it and it does work.


<dtml-call "REQUEST.set('SearchResultString', 'This is probably the
clunkiest most primitive way to do it, but you could use
string.replace..')">
<dtml-call "REQUEST.set('QueryString', 'clunkiest')">
<dtml-call "REQUEST.set('newSString',
_.string.replace(SearchResultString, QueryString, '<b>' + QueryString +
'</b>'))">
<dtml-var newSString>

Good luck, please post your results if you find something more elegant,
Im interested.

Paul Zwarts

-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of
James van der Veen
Sent: Monday, October 29, 2001 2:58 PM
To: 'zope@zope.org'
Subject: [Zope] How to get Query string in bold

Hi,

I was wondering if anyone could help me with this.
I let people search in all the Objects in a folder (with newsitems)
I then would like to display the results and show the first 300 chars of
the
news message. This far everything works fine.
What I would like to do now is if the first 300 chars of the message
conain
their search string to show this in bold.
Does anybody have a tip for me on this subject?

Greetz,
James

_______________________________________________
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 )