[Zope] computing id and using it to display text from a DTML method

Rob Page rob.page@digicool.com
Sat, 22 May 1999 08:59:45 -0400


> I had thought of building the contents as a "sandwich", 
> pulling everything
> before the 'M23' from one method, then the string 'M23', then 
> the remainder from
> another method.  But I can't save a method that looks like 
> broken DTML, i.e.
> that ends with '<!--#var '.

Aaahh, yes.

I should have thought of this earlier... I use this recently learned
trick on an internal system at the office:

<!--#in sqlSelectJobOffer-->

  <!--#var expr="_.getattr(PositionDescriptions, pd_doc_name)(_.None,
_)"-->

<!--#/in sqlSelectJobOffer-->

where PositionDescriptions is a folder in my acquisition hierarchy and
pd_doc_name is a column returned in the SQLMethod sqlSelectJobOffer
which contains the id of the document I want to insert.  Of course, you
could hijack the pd_doc_name earlier in the DTML Method and/or stuff it
into the REQUEST.

--Rob