铁路由器和流星所需的建议

Advice required on iron router and meteor

如何获取左侧(边栏)的链接以在屏幕右侧打开单独的页面?

我一直在浏览 google 搜索提供的一些教程。我尝试将 {{> yield}} 放入正文中,但这样做会把一切都搞砸。我的理解是 yield 必须放在路由页面必须出现的地方。请告诉我该怎么做。

到目前为止,这是我的代码:

<body>
    <div id= 'wrapper'> 
        <div id="sidebar-wrapper">
            {{> SideBar}}
        </div>
        <div id="page-content-wrapper">
        {{> PageContent}}
        </div>
    </div>
</body>


<template name ='SideBar'>
            <ul class="sidebar-nav">
                <li class="sidebar-brand">
                    <a href="#">Start Bootstrap  </a>
                </li>
                <li>
                 <a href="{{ pathFor 'Dashboard' }}">Dashboard</a>
                </li>
                <li>
                    <a href="{{ pathFor 'Overview' }}">Overview</a>
                </li>
            </ul>
 </template>   

<template name ='PageContent'>
                   <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <h1>Simple Sidebar</h1>
                         **{{> yield}}**
                    </div>
                </div>
            </div>
</template>

点击 Dashboard/Overview 应在屏幕右侧呈现以下模板

<template name ='Dashboard'>
       <h1> testing dashboard</h1>
</template>

<template name ='Overview'>
   <h1> testing Overview</h1>
</template>

这是我的routes.js

Router.route('/Dashboard', function(){this.render('Dashboard');
                                     });
Router.route('/Overview', function(){this.render('Overview');
                                    });


Router.route('/profiles/manuel', function () {
this.layout('profileLayout');
this.render('profileDetail');
});

Config.js:

Router.configure({
layoutTemplate: 'PageContent'
});

1: 移除 body 标签。

2.Include 个人资料布局模板中 body 标签的内容。 这对我有用。