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

[Cheetahtemplate-discuss] Append to #block?

Expand Messages
  • ksmith93940-dev@yahoo.com
    Is it possible to append to block? master_template.html .... #block javascript ....
    Message 1 of 3 , Jun 25, 2005
      Is it possible to append to block?

      master_template.html
      <html>
      <head>....
      #block javascript
      <script src="my.js"....
      #end block
      <body>
      ....
      </html>

      child_template.html
      #extends master_template

      #block javascript
      $javascript
      <script src="myadditional.js"....
      #end block

      This method causes a recursive loop, I've tried a
      couple of other ways to no avail. Am I just missing
      something?

      If not, perphaps a new directive?

      #appendable javascript
      <script src="myaddiontonal.js"
      #end appendable


      or compiler directive?

      Kevin Smith
      BTW: IMO Cheetah is templating finally done right,
      thanks for all your great work.





      -------------------------------------------------------
      SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
      from IBM. Find simple to follow Roadmaps, straightforward articles,
      informative Webcasts and more! Get everything you need to get up to
      speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Jose Galvez
      Dear Keven, I m not sure what you are trying to do with this code. the endless loop makes sense because you are calling $javascript withing javascript (which
      Message 2 of 3 , Jun 25, 2005
        Dear Keven,

        I'm not sure what you are trying to do with this code. the endless loop
        makes sense because you are calling $javascript withing javascript
        (which is created as a functions so its equivalent to
        def javascript(self):
        self.javascript()

        In any event if you want to append to the block, you can append to a
        variable within the block, but like I said I'm not really sure what you
        want to do. Could you give a little more info or a more complete
        example. Are you running the cheetah templates directly (like psp
        files)? or are you calling them from within a servlet (of which there
        are several methods to do this)? Sorry more questions then help I know.

        Jose

        ksmith93940-dev@... wrote:

        >Is it possible to append to block?
        >
        >master_template.html
        ><html>
        > <head>....
        > #block javascript
        > <script src="my.js"....
        > #end block
        ><body>
        >....
        ></html>
        >
        >child_template.html
        >#extends master_template
        >
        >#block javascript
        >$javascript
        > <script src="myadditional.js"....
        >#end block
        >
        >This method causes a recursive loop, I've tried a
        >couple of other ways to no avail. Am I just missing
        >something?
        >
        >If not, perphaps a new directive?
        >
        >#appendable javascript
        ><script src="myaddiontonal.js"
        >#end appendable
        >
        >
        >or compiler directive?
        >
        >Kevin Smith
        >BTW: IMO Cheetah is templating finally done right,
        >thanks for all your great work.
        >
        >
        >
        >
        >
        >-------------------------------------------------------
        >SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
        >from IBM. Find simple to follow Roadmaps, straightforward articles,
        >informative Webcasts and more! Get everything you need to get up to
        >speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
        >_______________________________________________
        >Cheetahtemplate-discuss mailing list
        >Cheetahtemplate-discuss@...
        >https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
        >
        >
        >
        >
        >



        -------------------------------------------------------
        SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
        from IBM. Find simple to follow Roadmaps, straightforward articles,
        informative Webcasts and more! Get everything you need to get up to
        speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      • Tracy S. Ruggles
        I think this is what you want: ## parent.tmpl Begin... #block inner -- the middle -- #end block End. ## child.tmpl #extends parent #block inner -- pre-middle
        Message 3 of 3 , Jun 26, 2005
          I think this is what you want:

          ## parent.tmpl
          Begin...
          #block inner
          -- the middle --
          #end block
          End.


          ## child.tmpl
          #extends parent

          #block inner
          -- pre-middle --
          $parent.inner($self)
          -- post-middle --
          #end block inner


          --Tracy


          On Jun 25, 2005, at 10:52 PM, <ksmith93940-dev@...>
          <ksmith93940-dev@...> wrote:

          > Is it possible to append to block?
          >
          > master_template.html
          > <html>
          > <head>....
          > #block javascript
          > <script src="my.js"....
          > #end block
          > <body>
          > ....
          > </html>
          >
          > child_template.html
          > #extends master_template
          >
          > #block javascript
          > $javascript
          > <script src="myadditional.js"....
          > #end block
          >
          > This method causes a recursive loop, I've tried a
          > couple of other ways to no avail. Am I just missing
          > something?
          >
          > If not, perphaps a new directive?
          >
          > #appendable javascript
          > <script src="myaddiontonal.js"
          > #end appendable
          >
          >
          > or compiler directive?
          >
          > Kevin Smith
          > BTW: IMO Cheetah is templating finally done right,
          > thanks for all your great work.
          >
          >
          >
          >
          >
          > -------------------------------------------------------
          > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
          > from IBM. Find simple to follow Roadmaps, straightforward articles,
          > informative Webcasts and more! Get everything you need to get up to
          > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
          > _______________________________________________
          > Cheetahtemplate-discuss mailing list
          > Cheetahtemplate-discuss@...
          > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
          >
          >




          -------------------------------------------------------
          SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
          from IBM. Find simple to follow Roadmaps, straightforward articles,
          informative Webcasts and more! Get everything you need to get up to
          speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
          _______________________________________________
          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.