For this sort of thing, I just use a simple string-manipulating helper:
http://gist.github.com/134988

On Tue, Jun 23, 2009 at 1:11 PM, scottwb <[email protected]> wrote:

>
> I bet somebody has a better way, but here's something I've done before
> - capture the haml and then render it with or without the %body based
> on your conditional. Not real pretty, but at least the ugliness is
> mostly just confined to the top and bottom of the file. Something like
> this:
>
> - body = capture_haml do
>  - ...haml for everything in layout...
>
> - if request.env['HTTP_USER_AGENT'] !~ /msie/i
>  %body= body
> - else
>  = body
>
>
> Noel_g wrote:
> > Following up on this compass thread
> >
> >
> http://groups.google.com/group/compass-users/browse_thread/thread/fbe8470caccec27b
> >
> > What would be the best way to implement the conditional body tag in my
> > HAML layout?
> >
> >
> http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
> >
> > I thought I could do
> > /[if !IE]
> > %body
> > /[endif]
> >
> > but that doesn't work.  On the Compass thread someone mentioned that
> > it would need to be done in erb.
> >
> > So would I do
> >
> > :erb
> >   <!--[if !IE]>--> <body> <!--<![endif]-->
> >
> > Is this the best way to do this?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to