Google Groups Home
Help | Sign in
How do I vary certain contents based on a page property
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
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
Pauli  
View profile
 More options 9 Jul, 16:54
From: Pauli <pauli.pr...@gmail.com>
Date: Wed, 9 Jul 2008 08:54:06 -0700 (PDT)
Local: Wed 9 Jul 2008 16:54
Subject: How do I vary certain contents based on a page property
( returning to staticmatic after long break )

How do I vary certain contents based on a page property?  I'm thinking
this:

some-page.haml

- type = "category1"

layout.haml

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

( momentarily without ability to lookup syntax for partial inclusion
==> "dayjob")

Will this work?  Do you recommend another method?

Thanks,

Pauli


    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.
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.
End of messages
« Back to Discussions « Newer topic     Older topic »

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