orionjs / orioncms

[Old] Orion is an open source framework built on Meteor that makes complex as well as simple apps possible with minimal effort.
http://orionjs.org
MIT License
715 stars 129 forks source link

orion:pages feature support named content spaces in dynamic layouts #413

Open sean-stanley opened 8 years ago

sean-stanley commented 8 years ago

When setting up a page template with orion.pages.addTemplate it would be nice to copy the AccountsTemplates.configure api options to include something like defaultLayoutRegions: Object that will simply append the object to the layout's data context. This way a more complex dynamic layout using more than just "yield" can be used for setting up pages.

In my particular instance some pages have different navbars and footers. Rather than have two layouts I use {{<Template.dynamic nav=nav}} to determine which navbar to return.

Currently pages generated with orion:pages will have no value for nav and thus will not render any template in this zone.

A not-great workaround is using if/else to assign a default navbar or footer.

I can write a pull request for this at some point if interested.