[Nitro] Nitro templating question

Bryan Soto bryan.a.soto at gmail.com
Sat Jan 7 13:48:38 EST 2006


So rather than elements, James would like external layouts similar to Rails
and Rob would like to be able to specify external template files rather than
coding the view in the element itself. Correct?

So how should it work?

According to the Rails book, a layout should be defined with the same name
as the controller, and any action called on that controller will use that
template. I'm sure they also have a method where you can specify a different
name. So that's one option.

And for elements, perhaps a new property, Element.template_root, where a
directory is stored, and any element rendered looks there for it's
corresponding template file, i.e. Page would look for #{
Element.template_root}/page.xhtml. Overridable by a method name in the tag
perhaps?

Any other ideas on either of these anybody?

On 1/7/06, rob <rob at motionpath.com> wrote:
>
> Spooky, I was discussing this with Chris yesterday. I also would
> prefer external template file support for elements.
>
> On 7 Jan 2006, at 11:06, 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
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20060107/6f82b436/attachment.html 


More information about the Nitro-general mailing list