Cells

Cells are sections on a page and are acting as containers for elements.

1 Defining cells

Cells are defined here:

config/alchemy/cells.yml

You also have to define the cells to use in your config/alchemy/page_layouts.yml

Please be aware: You can only add elements that are both defined in your cells.yml and page_layouts.yml!

1.1 Example

cells.yml


- name: left_column
  elements: [image, text]

page_layouts.yml


- name: standard
  cells: left_column
  elements: [image, text]

Normally cells are rendered on page_layouts. They can be called with this helper method:


<%= render_cell(:cellname) %>

If you render cells like this, an additional view-partial is rendered, naming scheme is /app/views/alchemy/cells/_left_column.html.erb

In this partial use <%= render_elements :from_cell => 'left_column' %> to render cell-related elements only.