can I somehow render a template in a specific yield from an event using iron router?
Template:
<template name="groupDetails">
{{#with selectedGroup}}
<h2>{{name}}</h2>
{{> groupNav}}
{{> yield 'groupOption'}}
{{/with}}
</template>
Event action:
Template.groupNav.events({
'click .groupStatisticsNavLink': function () {
layout.render('stats', { to: 'groupOption' });
}
});
I want to render a template called "stats" in a yield named "groupOption" from pressing a button.
Inside template helpers and events, you can just use a reference to Iron.controller(), which returns the current RouteController.
var controller = Iron.controller();
// you now have access to all controller properties and methods
so your event would look like
Template.groupNav.events({
'click .groupStatisticsNavLink': function () {
var controller = Iron.controller();
controller.render('stats', { to: 'groupOption' });
}
});