marionettejs / backbone.marionette

The Backbone Framework
https://marionettejs.com
Other
7.06k stars 1.26k forks source link

Use template as el #2357

Closed designermonkey closed 7 years ago

designermonkey commented 9 years ago

One thing I find increasingly annoying about Backbone is it's penchant for wrapping everything in a div. While using LayoutManager for a short time, I liked how a developer could set the el of a View to false, so as to tell LayoutManager to use the provided template as the Views el.

IMO, this should be a part of Marionette also. There is already the option to pass false to template to disable it, so would follow suit in that regard.

It would be optional and defaulted to the current behaviour to not break any backwards compatibility.

From what I can see of the source code, it's not easily something that can be monkey patched in an extension of View either, although I am really going to try.

Any thoughts?

paulfalgout commented 7 years ago

I'm pretty confident this will be settled using custom renderers in the future and should not be an option on the view. The user will have to be aware per render on how it will interact with default backbone.view behavior, but it won't be Marionette itself modifying this. We can re-open if someone disagrees.