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

[Cheetahtemplate-discuss] #extends directive

Expand Messages
  • n00m
    Hi dear All! I never managed to get working this example from Cheetah docs: === For instance, consider this template, FrogBase.tmpl: #def title This document
    Message 1 of 1 , Jul 14, 2008
    • 0 Attachment
      Hi dear All!
      I never managed to get working this example from Cheetah docs:
      ===
      For instance, consider this template, FrogBase.tmpl:

      #def title
      This document has not defined its title
      #end def
      #def htTitle
      $title
      #end def
      <HTML><HEAD>
      <TITLE>$title</TITLE>
      </HEAD><BODY>
      <H1>$htTitle</H1>
      $body
      </BODY></HTML>

      And its subclassed document, Frog1.tmpl:

      #from FrogBase import FrogBase
      #extends FrogBase
      #def title
      The Frog Page
      #end def
      #def htTitle
      The <IMG SRC="Frog.png"> page
      #end def
      #def body
      ... lots of info about frogs ...
      #end def
      ===

      I have two files, in the same dir, base.tmpl and phone.tmpl
      (in fact, they are HTML files)
      t = Template(file=root_dir+'templs/phone.tmpl', searchList={'p': ans})
      Trying to extend base.tmpl from inside phone.tmpl I get the error message:
      = no module base =

      How to make it working?





      -------------------------------------------------------------------------
      This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
      Build the coolest Linux based applications with Moblin SDK & win great prizes
      Grand prize is a trip for two to an Open Source event anywhere in the world
      moblin-contest.org/redirect.php?banner_id=100&url=http://moblin-contest.org/
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    Your message has been successfully submitted and would be delivered to recipients shortly.