[Zope] ZSearch Results Calling URL?

Michel Pelletier michel@digicool.com
Thu, 24 May 2001 21:43:53 -0700 (PDT)


On Thu, 24 May 2001, Tim Cook wrote:

> Leigh Ann Hildebrand wrote:
> >
> > I'm modifying the standard ZSearch results and having problems calling
> > object URLS using DTML.
> >
> > I'm doing a search of documents. The standard search results include
> > <dtml-var title> in the table. I'd like that title to be a link to the
> > document itself. However, various methods I've tried end up returning
> > the URL as the Results page itself, not the document page:
> >
> > <td><a href="<dtml-var absolute_url>"><dtml-var title></a></td>

Let me guess, you don't have a meta-data table column named
'absolute_url', do you?  If you did, this would work.  But don't add one
because there's a better way.

> > ...does it, as does plain <dtml-var URL>, etc.
> >
> > How do I specify "URL of the thing that you're giving me the title of"
> > in this situation?
>
> Try:
> <a href="<dtml-var "Catalog.getpath(data_record_id_)">"><dtml-var
> title></a>
> See the ZCatalog API documentation.

This works too, but 2.3 added new interfaces to brains:

<td><a href="<dtml-var getURL>">... is the best way.

-Michel

PS there's also getPath, getRID, and getObject.