librelist archives

« back to archive

Can't set template in not_found page

Can't set template in not_found page

From:
Date:
2012-03-27 @ 20:57
Sent from my BlackBerry® wireless device

-----Original Message-----
From: David Robertson <david@davidr.me>
Date: Tue, 27 Mar 2012 21:52:34 
To: <nesta@librelist.com>
Subject: Can't set template in not_found page

Hello everyone.

I'm making a custom nesta theme for my site. I started with the 'slate'
theme but there's almost nothing left of that now.

My problem is that I can't seem to set the template in the not_found.haml
file.

not_found.haml

Template: simple

.row
  .span8.content
    #content
      %h5.pull-right.fourohfour 404 Not Found
      %h1
        Awhh, damnit!


      %p
        %h3
          Hmm... Not sure where that page went to... Why not go to the
          %a{"href" => "/"} home page
          instead?


  .span4
    = haml :sidebar, :layout => false

Unfortunately this spits out the literal string "Template: simple".

How can I make this page use a template?

Re: [nesta] Can't set template in not_found page

From:
Graham Ashton
Date:
2012-03-28 @ 08:45
On 27 Mar 2012, at 21:57, david@davidr.me wrote:

> I'm making a custom nesta theme for my site. I started with the 'slate' 
theme but there's almost nothing left of that now.
> 
> My problem is that I can't seem to set the template in the not_found.haml file.

not_found.haml is in views, so doesn't support any of that metadata stuff.
Rather than being a Nesta page, it's a Sinatra template.

Support for re-using page templates with error pages hasn't had a lot of 
thought, but you will be able to re-use your HTML with clever use of 
partials (e.g. `haml :foo, :layout => false`) in page.haml and 
not_found.haml.

Graham

Re: [nesta] Can't set template in not_found page

From:
Date:
2012-03-28 @ 09:49
Ah okay, this makes sense now.  I ended up just copying and pasting the 
template around the stuff in the error page anyway. 

Thanks, David Robertson. 
------Original Message------
From: Graham Ashton
Sender: nesta@librelist.com
To: nesta@librelist.com
ReplyTo: nesta@librelist.com
Subject: Re: [nesta] Can't set template in not_found page
Sent: 28 Mar 2012 09:45

On 27 Mar 2012, at 21:57, david@davidr.me wrote:

> I'm making a custom nesta theme for my site. I started with the 'slate' 
theme but there's almost nothing left of that now.
> 
> My problem is that I can't seem to set the template in the not_found.haml file.

not_found.haml is in views, so doesn't support any of that metadata stuff.
Rather than being a Nesta page, it's a Sinatra template.

Support for re-using page templates with error pages hasn't had a lot of 
thought, but you will be able to re-use your HTML with clever use of 
partials (e.g. `haml :foo, :layout => false`) in page.haml and 
not_found.haml.

Graham


Sent from my BlackBerry® wireless device