Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double rendering? #74

Open
Orbyt opened this issue Jul 10, 2016 · 2 comments
Open

Double rendering? #74

Orbyt opened this issue Jul 10, 2016 · 2 comments

Comments

@Orbyt
Copy link

Orbyt commented Jul 10, 2016

For some reason whenever I render a layout into a template, it just gets rendered below all other content on the page. I've posted this on the Meteor forums as well but here is the code:

<body>
    ...
    {{> layout}}
</body>

<template name="layout">

    <div class="container full-container">
        <div class="row full-row">
            <div class="col-md-2 left-bar" style="background:#800000;">
                <div class="row">
                    <div class="col-md-12">
                        {{> avatar size="large" shape="circle"}}
                    </div>
                </div>
            </div>
            <div class="col-md-10">
                {{>Template.dynamic template=content}}
            </div>
        </div>
    </div>
</template>

<template name="usercard">
    ...
</template>

<template name="home">
    <div class="row">
        {{#each playerslooking}}
            {{> usercard}}
        {{/each}}
    </div>
</template>

<template name="find_page">
    <div style="height:150px;width:150px;background:blue;">hello</div>
</template>

JS:

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

FlowRouter.route('/find/:_id', {
  name: 'postfind.show',
  action: function() {
    BlazeLayout.render('layout', {content: "find_page"});
  }
});

What happens is that it seems to double render my .full-row

for some reason. This puts all content below the page.

I'm guessing this is user error but im not sure what im doing wrong.

Paint skills:
What Im going for:
http://prntscr.com/br8xh6

whats happening:
http://prntscr.com/br8z8p

Related: http://stackoverflow.com/questions/34299849/blazelayout-rendering-content-to-a-dynamic-template-but-the-content-is-appearin

@Orbyt
Copy link
Author

Orbyt commented Jul 11, 2016

So I was just going through some more tutorials trying to debug, and ran the followinng:

<template name="mainLayout">

    {{>Template.dynamic template=content}}

</template>

I did not include the mainLayout template anywhere, yet it still showed up. How? If the dynamic templates just popup by themselves, how are you supposed to structure your layout?

@ghost
Copy link

ghost commented Jan 28, 2017

Hey, did you figure it out?? having the same issue with a navbar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant