[Nitro] Nitro templating question

Jonas Pfenniger zimba.tm at gmail.com
Mon Jan 9 12:18:58 EST 2006


George Moschovitis wrote:

>>What I've found in skin.rb is a bunch of disconnected HTML embedded as
>>raw strings in Ruby code.  For anything but the most trivial page layout
>>that is a nightmare to design and maintain.
>>    
>>
>
>
>Really?
>
>I think rails layout system is only usefull for small, silly
>applications. Like many original rails features this seems tailored to
>37signals simplistic applications, this is not a general solution. I
>find Nitro's elements or xslt compilers to be much more intuitive,
>elegant and powerful. I mean:
>
><Page>
>  ..
></Page>
>
>
>and
>
>
>class Nitro::Element
>  class Page
>     def render
>        %~
><html>
>   <head>
>   </head>
>   <body>
>    ...
>    ...
>    #{content}
>    ...
>    #{content :sidebar} <!-- renders content from sidebar -->
>   ...
></html>
>        ~
>     end
>end
>
>is quite easy to do. I can easily add external template file support
>for elements to make this better for you (ie keep th render xhtml in a
>separate .xhtml file). Any other ideas?
>
>regards,
>George.
>
>--
>http://www.gmosx.com
>http://www.navel.gr
>http://www.nitrohq.com
>
>_______________________________________________
>Nitro-general mailing list
>Nitro-general at rubyforge.org
>http://rubyforge.org/mailman/listinfo/nitro-general
>
>  
>
George,

I have some questions regarding the Elements.

I understand #{content :sidebar} use a child element, but I don't know
where to set it up. Is there an accessor in the controller for it ?

What is the difference between a Control and an Element ?

How do you change the template surrounding a page without changin the
enclosing tag ? eg. I use <Page> around my content, but sometimes I want
a different html template. It there a mechanism for this ?

Cheers,
   zimbatm



More information about the Nitro-general mailing list