Meteor - Iron Router : {{>yield}} is not working -
my problem that:
1- "{{>yield}}" not working properly. when remove "{{>yield}}" template, template shows properly. if place "{{>yield}}" in template, empty body tag displayed.
2- if remove "{{>adlayout}}" body tag, empty body tag displayed.
i have following template code :
<head> <title>my metronic</title> <meta charset="utf-8"/> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta content="width=device-width, initial-scale=1.0" name="viewport"/> <meta content="good description" name="description"/> <meta content="dave alex" name="author"/> <!-- begin global mandatory styles --> <link href="http://fonts.googleapis.com/css?family=open+sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css"/> <link href="assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/> <link href="assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/> <link href="assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/> <!-- end global mandatory styles --> <!-- begin theme styles --> <link href="assets/global/css/components.css" rel="stylesheet" type="text/css"/> <link href="assets/global/css/plugins.css" rel="stylesheet" type="text/css"/> <link href="assets/admin/layout/css/layout.css" rel="stylesheet" type="text/css"/> <link id="style_color" href="assets/admin/layout/css/themes/default.css" rel="stylesheet" type="text/css"/> <link href="assets/admin/layout/css/custom.css" rel="stylesheet" type="text/css"/> <!-- end theme styles --> <link rel="shortcut icon" href="favicon.ico"/> </head> <body> {{> adlayout }} </body> <template name="adlayout"> {{> adheader}} <div class="clearfix"></div> <div class="page-container"> {{> adsidebar}} <!-- begin content --> <div class="page-content-wrapper"> <div class="page-content"> <!-- begin sample portlet configuration modal form--> <!-- end sample portlet configuration modal form--> <!-- begin style customizer --> <!-- end style customizer --> <!-- begin page header--> <div class="row"> <div class="col-md-12"> <!-- begin page title & breadcrumb--> {{> adbreadcrumb}} <!-- end page title & breadcrumb--> </div> </div> <!-- end page header--> <!-- begin page content--> <div class="row"> <div class="col-md-12"> page content goes here - 22 {{>yield}} </div> </div> <!-- end page content--> </div> </div> <!-- end content --> </div> {{> adfooter}} </template>
following router settings :
router.configure({ layouttemplate : 'layout' }); router.map(function(){ this.route('myhello', { path: '/mine', controller : 'myhellocontroller' }); });
following "myhellocontroller" :
myhellocontroller = routecontroller.extend({ layouttemplate: 'adlayout', template: 'hello', waiton: function () { //return meteor.subscribe('waitingfor'); }, data: function () { /* data = {waitingfor: 'no wait for'}; return data; */ }, onbeforeaction: function () { }, onafteraction: function () { }, action: function () { this.render(); } });
can 1 guide me doing wrong , how can rectified.
you can more details of whats going on looking @ chrome's javascript console. likley have exception somewhere in code. {{>yield}} wont render because of issue templates involved in route you're trying display.
its hard tell given information you've provided error is. ordinary js error.
the errors in template's helpers or rendered function (if have any).
it may subtemplates aren't rendering or have errors in helpers, such adfooter
or adsidebar
.
Comments
Post a Comment