I have been playing around with Meteor lately and i am loving it, but 5 minutes into a project i am having a problem with rendering templates after calling {{ pageRender }} (Taking note that specifically {{>renderPage }} only render what Iron Router was told to render and ignores any other calls.)
The current code below works perfectly fine since it is still basic configuration, but the footer template is getting called "before" the dynamic page is rendered, which is resulting in the footer appearing above all page content. I have also tried to move the footer text into the main.html fine but the footer is still rendered before the {{ renderPage }} content.
Iron Router Js:
Router.route('/', function () {
this.render('Home', {
//data: function () { return Items.findOne({_id: this.params._id}); }
});
});
HTML source:
<head>
<title>NDA Site</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<!-- Render Navigation -->
{{> navigation }}
<!-- Render Page (Anything gets closed before render is called canceling grid out. Grid has been moved to each template for accuracy)-->
<div class="renderPage-wrapper">{{ renderPage }}</div>
<!--{{> footer }}
footer will not render after renderPage. Footer has been added to main.html as show below-->
<div class="container"><div class="row">
<div class="col-lg-6">
<p>YourSite © {{year}}. All rights reserved.</p>
</div>
<div class="col-lg-6 text-right">
<p>Powered by: NDA Site 0.1.2</p>
</div>
</div></div>
</body>
Template source:
<template name="footer">
<div class="container"><div class="row">
<div class="col-lg-6">
<p>YourSite © {{year}}. All rights reserved.</p>
</div>
<div class="col-lg-6 text-right">
<p>Powered by: NDA Site 0.1.2</p>
</div>
</div></div>
</template>
Any ideas of a work around? Or an explanation of why the render hierarchy is being ignored after the client runs {{ renderPage }}?
Sincerely, Willie (Doc) W.