Loading ...
Sorry, an error occurred while loading the content.

1530Re: [Cheetahtemplate-discuss] #set global

Expand Messages
  • Mike Orr
    Oct 2, 2002
      On Wed, Oct 02, 2002 at 09:37:53AM -0700, Mike Orr wrote:
      > On Tue, Oct 01, 2002 at 06:24:33PM -0600, Mike Warren wrote:
      > > iron@... (Mike Orr) writes:
      > >
      > > > You can also put $searchList in the template to see what the searchList
      > > > contains. The first item should be the dictionary of globals (i.e., it
      > > > should have a 'mike' key).
      > >
      > > I just get ``[{}, <Cheetah.Parser.GenTemplate instance at
      > > 0x844bbec>]'' if I put ``$searchList'' in my included
      > > template.
      > Sure enough, the included file is not picking up the main searchList.

      But the included searchList is correct if you comment out
      #extends Base
      in the include file. "Correct" meaning it's identical to the main
      searchList. You may be getting hit by the "double-initialize" bug
      that has been observed with #extends in certain cases. The case
      we've found is when you give the Template constructor a string or
      file containing "#extends" (rather than filling a precompiled
      template, which works).

      Can you get by without Base features in the include file for now?

      Actually, I don't think you even have to do that. Since the main
      template inherits from MyClass, all its methods are available to
      placeholders in the included template too. Of course that means
      the include file won't work if the main template doesn't inherit
      from MyClass, but maybe that's an inappropriate use of the include
      template anyway.

      -Mike (Iron) Orr, iron@... (if mail problems: mso@...)
      http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol

      This sf.net email is sponsored by:ThinkGeek
      Welcome to geek heaven.
      Cheetahtemplate-discuss mailing list
    • Show all 10 messages in this topic