Skip to content

Instantly share code, notes, and snippets.

@petehuang
Last active August 29, 2015 14:00
Show Gist options
  • Save petehuang/11386300 to your computer and use it in GitHub Desktop.
Save petehuang/11386300 to your computer and use it in GitHub Desktop.
<template name="mainTemplate">
{{#if isPhone}}
{{> mobileTemplatePartOne}}
{{else}}
{{> desktopTemplate}}
{{/if}}
</template>
<template name="mobileTemplatePartOne">
//first half of stuff
<a href="{{ pathFor 'mobileTemplatePartTwo' }}">Second Part</a>
</template>
<template name="mobileTemplatePartTwo">
//second half of stuff
</template>
<template name="desktopTemplate">
//all the stuff
</template>
Router.map(function() {
this.route('mainTemplate', {
path: '/main'
});
this.route('mobileTemplatePartTwo', {
path: '/main/parttwo',
action: function() {
if (Meteor.device.isPhone() == false) {
Router.go('/main');
}
else {
this.render();
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment