Skip to content

Making regions more usable. #11

Description

@tmeasday

Howdy @cmather

So I'm working on converting Verso over to BL and it makes heavy use of layouts. One thing that we used to do with our old janky layouts system was bind helpers to regions. So something like

<template name="somePage">
  {{#Layout template='pageLayout' title=title}}
    ...
  {{/Layout}}
</template>

<template name="pageLayout">
  <h1>{{> yield region='title'}}</h1>
 {{> yield}}
</template>
Template.somePage.title = function() { return 'Dashboard'; }

So essentially we are passing the content for a region in via the arguments to {{#Layout.

What do you think?

Related ideas:

  • set a region content to a template in a similar way? titleTemplate='foo' perhaps?
  • remove the need for the redundant feeling title=title and just automatically search for a helper named title when trying to {{> yield region='title'}} if no content is set for that region.

Happy to implement whatever (actually I'll probably implement the first thing right now in a branch) if you agree on the API..

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions