0
我想從路由器遷移到鐵路由器,但有一個問題,我的整個頁面無法正確呈現。唯一的渲染模板是從「> yield」生成的。我的HTML文件中的任何其他代碼都不會呈現。試圖從路由器遷移到鐵路由器
我希望頁面上的所有內容保持靜態。但我希望yield中的模板根據url進行更改。我在配置中缺少什麼來使其表現如此?
HTML:
<head>
<title>carpool</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="wrap">
{{> page}}
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
{{> header}}
</div>
<div class="row-fluid">
<div class="span10">
<template name="mainContent">
{{> yield}}
</template>
</div>
<div class="span2">
{{#if currentUser}}
{{> leaderboard}}
{{/if}}
</div>
</div>
</div>
</div>
<div id="push"></div>
</div>
<div id="footer">
<div class="container">
{{> footer}}
</div>
</div>
</body>
<template name="page">
{{#if showAddEventDialogue}}
{{> addEvent}}
{{/if}}
{{#if showConfigLoginService}}
{{> configureLoginService}}
{{/if}}
{{#if showCalendarEventDetailsDialogue}}
{{> calendarEventDetailsDialogue}}
{{/if}}
</template>
JS:
/* Only execute if this is the client */
if (Meteor.isClient) {
// Client subscriptions
Meteor.subscribe('allCarpoolEvents');
Meteor.subscribe('allCarpoolDebts');
Meteor.subscribe('allUsers');
// Do not render the <body>
Router.configure({
autoRender: true
});
// Define Routes
Router.map(function() {
this.route('calendar', {
path:'/calendar*',
template: 'mainContent',
layoutTemplate: 'calendar'
});
this.route('list', {
path:'/list*',
template: 'mainContent',
layoutTemplate: 'list'
});
});
}