kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 194 forks source link

Simple Route "content" template will not render #525

Closed methodbox closed 8 years ago

methodbox commented 8 years ago

I've created a single route:

FlowRouter.route('/', {
    action: function() {
        BlazeLayout.render("nav", {content: "test"});
    }
});

"test" is a blaze template, but does not render. When added to the body of the nav, it renders:

<template name="nav">
     <nav>
    <div class="nav-wrapper">
      <a href="#" class="brand-logo">Logo</a>
      <ul id="nav-mobile" class="right hide-on-med-and-down">
        <li><a href="sass.html">Sass</a></li>
        <li><a href="badges.html">Components</a></li>
        <li><a href="collapsible.html">JavaScript</a></li>
      </ul>
    </div>
  </nav>

  {{> test}}
</template>

It's literally that simple. The router doesn't seem to render what it's instructed to render.

Given, this is my first time using FlowRouter, so maybe I'm missing something, but just following Meteor Routing Guide on Kadira for Blaze Templates.

My "test.html" is in /client/templates/test, but I've tried it directly in /client and also directly in /client/templates, makes no difference.

methodbox commented 8 years ago

Found the issue:

<main>
   {{>Template.dynamic template=content}}
</main>

Relatively equivalent to iron:router's {{> yield}}.

arunoda commented 8 years ago

So, we are good here.