notFoundTemplate Layout


Hello Folks,

I have two layout, one for application other for landing page.

For login and landing i use a blank template.

When user enter wrong address, iron-router will perfectly render my custom 404 page, but with application layout. I want blank layout. How can i do this? Similar questions asked before but non of them answered.

I tried Template.NotFound.rendered function to remove a few element on page, but MainLayout is too fragile to remove elements with JavaScript.


Router Configuration:

  layoutTemplate: 'MainLayout',
  loadingTemplate: 'Loading',
  notFoundTemplate: 'NotFound'


You should use the data not found plugin described here.

Here’s an example:

Router.plugin("dataNotFound", {
  notFoundTemplate: "notFound"


Thanks @fvilers but it doesn’t fix the issue :frowning:
I’ll look later on this.