meteor - Blaze layout always renders content after HTML structure -
I have created a simple Bootstrap 3 layout and want to use Blaze templates in the meteor, but the content of my template is always my HTML structure
Here is the code:
& lt; Head & gt; & Lt; Title & gt; Demo app & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; {{# ### Templates = "Main Layout" & lt; Template Name = "Home" & gt; {{Welcome Text}} & lt; / Template & gt; & Lt; Template name = "main layout" & gt; & Lt; Div class = "container" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-sm-6" & gt; Logo & lt; / Div & gt; & Lt; Div class = "col-sm-6" & gt; Login button & lt; / Div & gt; & Lt; / Div & gt; & Lt ;! - / header row - & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-sm-12" & gt; & Lt ;! - Navigation - & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;! - / nav row - & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-sm-12" & gt; {{& Gt; Yield area = "main content"}} & lt; / Div & gt; & Lt; / Div & gt; & Lt ;! - / content row - & gt; & Lt; / Div & gt; & Lt ;! - / container - & gt; & Lt; / Template & gt;
Javascript:
if (Meteor.isClient) {Template.home.welcomeText = function () {return "Welcome to my site." ; }; }
When I run it, the bootstrap structure works fine, but welcome text
is provided below the container.
layoutTemplate option is passed to my
iron router
route - now it is ignored Works.
Comments
Post a Comment