Can a layout have variables set by the page?

15 views
Skip to first unread message

BobTodd

unread,
Dec 16, 2010, 11:06:50 AM12/16/10
to StaticMatic
What I'd like to be able to do is declare a tag in my layout
containing the value of a variable.

The value of the variable (or placeholder) is set by the current page.

This is specifically for the page <title> tag.

Am I trying to bang a square peg into a round hole?

Thanks!

Stephen Bartholomew

unread,
Dec 16, 2010, 11:12:41 AM12/16/10
to StaticMatic
Yeah this is supported. You can just set an instance variable the way
you would in rails (if you've used that):

- @page_title = "My Great Page"

Then use it in the layout:

= @page_title

Steve
Reply all
Reply to author
Forward
0 new messages