Erik
Erik

Reputation: 93

Layout template will not yield

This has been driving me nuts all morning. (Forgive me, I'm new to meteor.) I have a fairly simple setup, following the habits described in Discover Meteor.

First, lib/router.js:

Router.configure({
   layoutTemplate: 'layout',
   loadingTemplate: 'loading',
   notFoundTemplate: 'notFound'
});

Router.route('/', {name: 'home'});

Router.route('profile', {name: 'UserProfile'});

Second, layout.html:

<template name="layout">
<div class="container">
    {{> navbar}}
    <div id="main">
        {{> yield}}
    </div>
</div>
</template>

And finally, client/templates/users/user_profile.html:

<template name="UserProfile">
    <p>hello world</p>
</template>

If I place {{> userProfile}} in the layout it renders fine. But the Router will not do the deed for me, as it ought.

What am I missing ?

Upvotes: 1

Views: 57

Answers (1)

httpNick
httpNick

Reputation: 2624

I was having this issue too... You didn't post your console output, but here was my solution (I answered my own question):

How to use yield and Iron-router?

In short this solved it for me: meteor add ejson

Upvotes: 1

Related Questions