Jeanluca Scaljeri
Jeanluca Scaljeri

Reputation: 29179

What happened with named yields in Meteor/Iron Router?

I'm trying to use named yields. When I search for it I find examples of how to use them:

Template:

{{> yield region="header"}}

Controller (Iron Router):

...
yieldTemplates: {
    'myHeader': {to: 'header'}
},
...

or

...
action: function () {
   if (this.ready()) {
      this.render();
      this.render({'myHeader': {to: 'header'}});
   }
},
...

However, I tried these, but they just don't work. I checked the Iron Router docs and there is no evidence of the existence of named yields. Does someone know what the current status is of named yields ?

Upvotes: 1

Views: 158

Answers (1)

Tarang
Tarang

Reputation: 75975

The iron router docs have been re-arranged slightly, perhaps this has happened since you last checked it, it was quite recent.

The section you're looking for is: https://github.com/EventedMind/iron-router/blob/devel/DOCS.md#using-a-layout-with-yields

You might have a typo with your this.render with yields, this might work instead:

this.render('myHeader', {to: 'header'});`

Upvotes: 1

Related Questions