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

Re: [Cheetahtemplate-discuss] Basic use of #extends

Expand Messages
  • Chris Stoyles
    Wow that works beautifully :) Thanks! Chris. ... Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs
    Message 1 of 4 , Mar 24 5:47 PM
    • 0 Attachment
      Wow that works beautifully :) Thanks!

      Chris.

      On Thu, Mar 25, 2010 at 8:33 AM, Tavis Rudd <tavis@...> wrote:
      Hi Chris,
      You can also use the cheetah import hooks to compile the base class dynamically (see the module Cheetah.ImportHooks).
      Cheers,
      Tavis


      On Thu, 25 Mar 2010, Chris Stoyles wrote:

      Ok so I worked it out last night. What wasn't obvious to me (which perhaps
      would have been had I read the user guide in its entirety) was that you
      create your HTML template (base.tmpl) first. You then run the "cheetah
      compile /path/to/base.tmpl" which creates your base.py file. I followed the
      same steps for my page template and then everything fell into place.
      Hopefully I've not wasted anyone's time.

      Thanks,
      Chris.

      On Wed, Mar 24, 2010 at 2:12 PM, Chris Stoyles <chriss@...> wrote:

      Hi Everyone,

      I am trying to do something which I think should be fairly trivial, but am
      yet to work out how to do it in Cheetah. I want a base template for my site
      (base.html) with a block in it (#block main_content) which I can fill-out or
      override in another template.

      In Django I would include the following statement at the top of my other
      template:
      {extends "/var/www/my/app/templates/base.html"}

      Then to fill in one of the blocks defined in base.html I would just do
      this:
      {% block main_content %}
      ...html...
      {% endblock %}

      I've tried my best to understand this page:
      http://www.cheetahtemplate.org/docs/users_guide_html_multipage/inheritanceEtc.extends.html but
      with no luck.

      Hopefully someone out there can quickly explain to me how I should go about
      this.

      Thanks,
      Chris.



    Your message has been successfully submitted and would be delivered to recipients shortly.