kadirahq / blaze-plus

Adds Props and State Management functionality to Meteor's Blaze Template Engine.
50 stars 4 forks source link

Issue with nested route templates with flow-router #4

Closed pronevich closed 7 years ago

pronevich commented 9 years ago

Can we use nested templates, like this? (base on flow-router-blaze-plus-example):


<template name="post">
  <h3>Post Content</h3>
  {{#if $loaded}}
    {{#if $post}}
      <span>Post Title</span>: {{$post.title}}
      <div>
        {{> Template.dynamic template=nestedTemplate}}  // like so ?
        {{>$ template=nestedTemplate }}  // or like so ?
      </div>
    {{else}}
      Not Found
    {{/if}}
  {{else}}
    Loading...
  {{/if}}
</template>

And route:

FlowRouter.route('/settings', {
  action: function(params) {
    BlazeLayout.render('layout', {main: 'post', nestedTemplate: "settings"});
  }
});

Seems now it's impossible.

How to be when we have basic layout where in {{>$ template=main slug=prop$slug }} changes our main templates and one of this templates 'settings' have tree tabs(buttons): that change route and 'nested template in settings' ?

With blaze-layout and flow-router it's work perfect, but when added blaze-plus - no.

arunoda commented 9 years ago

You need to pass nestedTemplate here as a prop to to the post template. I hope that's the way to do it here.

pronevich commented 8 years ago

Yes, it works, but re-render parent template unfortunately.