Update parent template's dynamic template include from child template

cpeele00

I'm pretty new to Meteor and need some help.

I have an outer parent template that contains a side slide menu. That side slide menu is using the new Blaze Dynamic Template include.

<div id="parentTemplate">

   {{>yield}}

   <div class="right-slide-menu">

      {{> UI.dynamic template=rightSideMenu}}

   </div>

</div>

So since I'm using Iron-router, when a new child template gets injected into "yield" from iron-router the right side menu needs to change depending on what "page" it is on now. I am trying to figure out how to update the parent Dynamic template slide menu from the child template. I can do this pretty easily with Angular...but I can't seem to figure this one out using Meteor.

Any help would be really appreciated!

cpeele00

Okay, I actually got this to work. I found the solution on this blog here:

http://empire5.com/development/meteor-rendering-a-handlebars-template-with-dynamically-loaded-data/

UI.render and UI.insert are deprecated (although it still works for now) so I adapted his instructions to the new way of doing this:

after upgrading to meteor 0.9.1 i keep getting "Warning: Blaze.insert has been deprecated."

So the final code looks like this:

<div id="parentTemplate">

   {{>yield}}

   <div class="right-slide-menu">

      <div class="sideMenu">

        <!-- side menu template gets injected here -->

      </div>

   </div>

</div>

Inside my child template manager I have this:

Template.dashboard.events({

    'click #showSideMenuBtn' : function(e){
        e.preventDefault();

        // pass in the name of the template you want to inject and 
        // also the parent container you want to inject it into
        Blaze.render(Template.addManagerForm, $('.sideMenu')[0]);

    };

});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Use child's inner class from parent template

From Dev

Template rendered order: parent triggers before child template(s)

From Dev

Meteor, call function in child template from parent template

From Dev

Accessing a variable set in a child template from the parent template with Twig

From Dev

Underscore Templates: passing variables from a parent template to a child template

From Dev

Passing variable from parent template to child template in meteor

From Dev

Underscore Templates: passing variables from a parent template to a child template

From Dev

Accessing a variable set in a child template from the parent template with Twig

From Dev

Django 1.11 - child template not inheriting from parent

From Dev

Play framework dynamic template include

From Dev

Dynamic include template angular directive

From Dev

Play framework dynamic template include

From Dev

django referencing child in parent template

From Dev

Binding to a property defined in the parent user control's code-behind from the control template of child custom control

From Dev

Binding to a property defined in the parent user control's code-behind from the control template of child custom control

From Dev

Pass a value from parent directive template to child directive

From Dev

Meteor ReactiveVar access parent tempate from child template

From Dev

Pass variables from child template to parent in Jinja2

From Dev

Passing spacebar data context from parent template to child

From Dev

django how to get field from child relationship into parent template

From Dev

How to pass a variable in PHP/Wordpress from child template to parent

From Dev

python flask: custom 404 child template only renders parent template's html file

From Dev

Handlebar.js to include another template in parent template

From Dev

Handlebar.js to include another template in parent template

From Dev

How does parent template pass data to child template?

From Dev

Insert child template into template of abstract parent in ui-router

From Dev

Cannot use the output of the inner (child ) template in the parent template in cloudformation

From Dev

Meteor JS: include dynamic name template in layout

From Dev

Return dynamic AliasSeq from template

Related Related

  1. 1

    Use child's inner class from parent template

  2. 2

    Template rendered order: parent triggers before child template(s)

  3. 3

    Meteor, call function in child template from parent template

  4. 4

    Accessing a variable set in a child template from the parent template with Twig

  5. 5

    Underscore Templates: passing variables from a parent template to a child template

  6. 6

    Passing variable from parent template to child template in meteor

  7. 7

    Underscore Templates: passing variables from a parent template to a child template

  8. 8

    Accessing a variable set in a child template from the parent template with Twig

  9. 9

    Django 1.11 - child template not inheriting from parent

  10. 10

    Play framework dynamic template include

  11. 11

    Dynamic include template angular directive

  12. 12

    Play framework dynamic template include

  13. 13

    django referencing child in parent template

  14. 14

    Binding to a property defined in the parent user control's code-behind from the control template of child custom control

  15. 15

    Binding to a property defined in the parent user control's code-behind from the control template of child custom control

  16. 16

    Pass a value from parent directive template to child directive

  17. 17

    Meteor ReactiveVar access parent tempate from child template

  18. 18

    Pass variables from child template to parent in Jinja2

  19. 19

    Passing spacebar data context from parent template to child

  20. 20

    django how to get field from child relationship into parent template

  21. 21

    How to pass a variable in PHP/Wordpress from child template to parent

  22. 22

    python flask: custom 404 child template only renders parent template's html file

  23. 23

    Handlebar.js to include another template in parent template

  24. 24

    Handlebar.js to include another template in parent template

  25. 25

    How does parent template pass data to child template?

  26. 26

    Insert child template into template of abstract parent in ui-router

  27. 27

    Cannot use the output of the inner (child ) template in the parent template in cloudformation

  28. 28

    Meteor JS: include dynamic name template in layout

  29. 29

    Return dynamic AliasSeq from template

HotTag

Archive