Search code examples
meteoriron-router

How to display different footer depending on the path in Meteor?


How to display different footers depending on the path? My current best try is this:

<template name="appLayout">
  <main role="main">
    {{> _header}}
    {{> yield}}
    {{#if Router.current().route.getName() = "sell-jewelry" }}
    {{> _minifooter}}
    {{/if}}
    {{#else}}
    {{> _footer}}
    {{/else}}
  </main>
</template>

Solution

  • I actually found the answer. This is what you need to do instead:

    <template name="appLayout">
      <main role="main"
      {{> _header}}
        {{> yield}}
        {{#if isActiveRoute regex='selljewelry'}}
        {{> _minifooter}}
        {{else}}
        {{> _footer}}
        {{/if}}
      </main>
    </template>