This seems like a basic one, but I cannot get the Iron Router to display my template in the right place on the page.
In my router controller, I have:
Router.configure({ loadingTemplate: 'loading', notFoundTemplate: 'notFound' }); Router.map(function () { this.route('home', { path: '/', template: 'home', layoutTemplate: 'layout' }); this.route('posts', { }); this.route('post', { path: '/posts/:_id' }); });
In the layout of the html page I have:
<body> <div class="container"> <template name="layout"> {{yield}} </template> </div> </body>
The basic version of the house template is as follows:
<template name="home"> <h1>Home Page</h1> </template>
I tried several variations of this, but the home template is always displayed at the bottom of the layout template immediately before the closing body tag, and not in the div.container
meteor
jamie holliday
source share