[Zope] getting <!-- --> sections to 'render' from an external method...

Rik Hoekstra hoekstra@fswrul.fsw.leidenuniv.nl
Fri, 21 May 1999 10:56:33 +0200


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Tony
> McDonald
> Sent: vrijdag 21 mei 1999 10:03
> To: Zope List
> Subject: [Zope] getting <!-- --> sections to 'render' from an external
> method...
>
>
> Hi all,
> I have an external method that creates different HTML dependent on
> some variables that are sent to it
>
> eg
> if given the values, content = 'zope is cool' and tagtype='item', the
> expression
> <!--#var expr="make_html(content, tagtype)"-->
>
> returns
> <ul>
> <li>zope is cool
> </ul>
>
> If I change the content to something like 'For the following
> exercise, use the conferencing system. <!--#var conference-->',
> tagtype='text'
>
> I want the <!--#var conference--> DTML to be left alone by the
> make_html external method so that Zope can get given it and then do
> all its good stuff.
>

Um, I don't know if I understand it quite right.

If the question was concerning what the method should return, then you could
either pass 'REQUEST' or 'self' (Depending on where the conference variable
is:in REQUEST, in a Folder)  to you method and have it return something like

'For the following exercise, use the conferencing system. %s'
%REQUEST['conference'],  tagtype='text'

If the question was concerning the way to pass a variable to an external
method, then the problem is that you can't use DTML inside an expression.
Change it to something like:

'For the following exercise, use the conferencing system. %s' %conference,
tagtype='text'


> At the moment, the <!--#var conference--> is just showing up as HTML
> comments in the output.
>
> Do I need to do some major magic at the external method?
>
> thanks for any thoughts...
> tone.
> ------
> Dr Tony McDonald,  FMCC, Networked Learning Environments Project
> The Medical School, Newcastle University Tel: +44 191 222 5888
> Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
>
> (For developer-specific issues, use the companion list,
> zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>