[Zope] How to use DocumentTemplate custom formats from Python?

G. David Kuhlman dkuhlman@netcom.com
Thu, 31 Aug 2000 18:27:07 -0700 (PDT)


> 
> Hamish Lawson wrote:
> > 
> > I'm using DocumentTemplate from Python (not in Zope) and I want to use
> > a custom format 'javascript_quote' that I've written. In my DTML file I
> > have:
> > 

  [snip]

> 
> 
> you should implement a formating function and register it with
> special_formats
> 
> for examples of both look near the end /DocumentTemplate/DT_Var.py
> 
> Kapil

Another suggestion -- If the thing identified by the 'name'
attribute is an instance of a class that you have implemented, then
implement javascript_quote as a method in that class.  If not, then
use Kapil's suggestion above.  In either case, you can find the
relevant code in /DocumentTemplate/DT_Var.py.  Search for
'special_formats' to find out how DocumentTemplate processing does
the lookup and applies the formatting format/function/method.

  - Dave

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