Barczewski, Jeff
2006-Jul-17 18:40 UTC
[Masterview-devel] Should masterview assume a generate destination of * if no mv:generate or mv:gen_partials are specified in the template?
My gmail account is down today so, sending this from my work account. I was thinking that for beginning users that the mv:generate thing is a brand new concept from all of the other templating systems so if they write some templates and don''t include those directives (mv:generate or mv:gen_partial) they won''t get any output and will be thinking it is broken. So much like rails assumes that if you don''t specify a render call in your controller that it should use the default render view, maybe MV should assume that if you don''t specify any mv:generate or mv:gen_partial calls that we should assume a mv:generate="*". And if their root is <html> then we would assume that they want the content of the body for this output so we would do essentially put this in the body tag <body mv:generate="*" mv:omit_tag="">, since typically this will be wrapped with a layout. If they don''t lead with <html> then we''d put the mv:generate="*" at the root and leave out the omit_tag.. This would make it easier for people that are starting out, to get something working especially if they have tried other similar template libs. The only issue I see with this is that if people have other non mv html files in their tree (not sure why they would though since they typically would be in public) then those would potentially generate rhtml as well. We could make the directive configurable as to whether it is enabled, but maybe that is overkill. If we make the assumption that either they won''t have non mv html files in their view dirs or that it doesnt matter if some extra rhtml files are created then we it should work fine. Ideas or thoughts? Thanks, Jeff