Learn how to utilize sections to build your Spree Storefront
File | Description | Example |
---|---|---|
ActiveRecord model | Defines the section’s preferences | Spree::PageSections::ImageWithText |
Storefront view | Renders the section in the storefront - each theme can have its own view | image_with_text.html.erb |
Admin page builder form | Configures the section in the admin panel | image_with_text/_form.html.erb |
section.blocks
and section.links
respectively.
Section belongs to a polymorphic parent model called pageable
which can be either Spree::Page
(content sections) or Spree::Theme
(layout sections).
You can access section’s theme by calling section.theme
.
Name | Description | Default Value |
---|---|---|
text_color | Color of text in the section | nil - uses theme’s text color |
background_color | Background color of the section | nil - uses theme’s background color |
border_color | Color of section borders | nil - uses theme’s border color |
top_padding | Padding space above section content (in pixels) | 40 |
bottom_padding | Padding space below section content (in pixels) | 40 |
top_border_width | Width of top border (in pixels) | 1 |
bottom_border_width | Width of bottom border (in pixels) | 0 |
Spree::PageSections::ImageWithText
has desktop_image_alignment
and vertical_alignment
preferences.