[Zope-CMF] Render question/Search term highlight

Dieter Maurer dieter@handshake.de
Thu, 29 Nov 2001 23:31:47 +0100


R. Herold writes:
 > Hello, during preparation of a forthcoming Zope-CMF-information portal, I
 > wondered how user-defined search terms could be highlighted in individual
 > web pages, e.g. when viewing a search result. I thought to have a special
 > viewing method, but I don't know how to render the body (which has em-tags
 > surrounding the search term). Headers and footers are rendered, but I don't
 > know how to return a rendered content from the modified self.document_src.
You take the string to define a DTML object
(e.g. an "OFS.DTMLMethod.DTMLMethod"; lighter variants are possible)
and then render this object.

Defining the object means instantiating the class (calling its constructor).

If your method is not trivial, you need to pass parameters into the rendering
(details in the "Calling DTML Objects" section of

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>

)


Dieter