Google Groups Home
Help | Sign in
Message from discussion How do I vary certain contents based on a page property
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
François Vaux  
View profile
 More options 9 Jul, 18:02
From: "François Vaux" <r...@yapok.org>
Date: Wed, 9 Jul 2008 19:02:08 +0200
Local: Wed 9 Jul 2008 18:02
Subject: Re: How do I vary certain contents based on a page property
2008/7/9 Pauli <pauli.pr...@gmail.com>:

> some-page.haml

> - type = "category1"

> layout.haml

> = unless ( type == "category1") partial-for-category1

> Will this work?  Do you recommend another method?

I don't know if this works with local variables, but I think it doesn't.

You'd rather use instance variables, something like ::

some-page.haml

  - @type = "category1

layout.haml
  = unless( @type == "category1") ...

This works great, and I use it a lot :)

- François


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google