Skip to content

Instantly share code, notes, and snippets.

@moretea
Created March 18, 2010 22:25
Show Gist options
  • Save moretea/336988 to your computer and use it in GitHub Desktop.
Save moretea/336988 to your computer and use it in GitHub Desktop.
demolicious/
|-- LICENSE
|-- README
|-- content_part_layouts
| |-- config.yml
| |-- homepage.erb.html
| `-- nl.yml
|-- images
|-- stylesheets
`-- views
OK, this is how it works:
-There is a implicit link between homepage.erb.html and themes.demolicious.homepage
-The config.yml file is special, it contains the definition of the parts used
in the content_part_layouts
-All other .yml files are loaded as i18n files.
#demolicious/content_part_layouts/homepage/config.yml
themes:
demolicious:
homepage:
parts: [common, right, bottom]
#demolicious/content_part_layouts/homepage/nl.yml
en:
themes:
demolicious:
homepage:
name: Default homepage
description: This is the default homepage
parts:
common: Common
right: Right
bottom: Bottom
nl:
themes:
demolicious:
homepage:
name: Standaard homepage
description: Dit is de standaard homepage layout
parts:
common: Algemeen
right: Rights
bottom: Onder
#demolicious/content_part_layouts/homepage.html.erb
<div id="page_container">
<div id="right">
<%= @page.parts.right %>
</div>
<div id="common">
<%= @page.parts.common %>
</div>
<div id="bottom">
<%= @page.parts.bottom %>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment