Ahh you only should have 1 <body> tag across all templates.
Then to switch which template is being shown it is easiest to use a router.
Instead of having two <body> elements, structure it like this:
<head>
<title>Hello</title>
</head>
<body>
<h1>Hello</h1>
{{> mainpage}}
</body>
<template name="mainpage">
HELLO
{{> loginButtons}}
</template>
<template name="otherpage">
Another Page Here
</template>
I would recommend reading up on Iron Router, or FlowRouter though.
Without them, you would need to use Blaze.render('otherpage') to change templates, either via a button or something.
Router makes it easy because it uses the URL path to choose templates.
Thanks cstrat…Its working…I will definitely read on routers for navigation.
Also would like to know about nice UI compoenents that can be used for web app using meteor.
I found UI designing with CSS bit time consuming.
Try Semantic UI! Good, relatively complete set of UI components, relatively little markup required, has an official, well-working Meteor integration package!
EDIT: And by “Try XYZ!” I mean to say that it’s something that I’m using and finding that as of right now it’s the best - easiest to use and easiest to adapt - markup-based UI framework that’s reasonably complete in terms of what components it offers.
Basically you don’t even need iron:router for this. Your template should just check if Meteor.userId() is set (through a helper) and if it is, then display not the login buttons but the actual content, depending on whether the user is an admin or not. Create another template helper that will help you determine that in the template.
And that’s it basically.
For iron:router you should definitely make sure you understand how the whole thing works, i.e. what are routes, views, and how you configure those. Googling for “iron router example” for instance yields a number of good resources right at the top. If I were in your shoes I’d accomplish what you need without iron:router and only afterwards take whatever time you need to learn about it and understand it and only then introduce the additional complexity. (Which is worth it, of course, once your mind is not actually occupied with learning other basics any more!)