Skip to content
Terry Wilson edited this page Sep 17, 2014 · 1 revision

f7_content_block - Content Block

This renders a single content block.

Usage

f7_content_block title, options, &block
f7_content_block options, &block

Supported options

As well as all the usual HTML options, you have these extra, helper specific options:

  • :title - Optional, some text to be displayed before the block.
  • :format - Configure the appearance. Take a single value or array:
    • :inner - The content is wrapped in an extra .content-block-inner (on iOS this is typical a white background).
    • :inset - An inset content block.
    • :tablet_inset - Inset on tablets only. Ignored if :inset is also specified.
  • :layout - Optional, allows you specify a layout to render a page partial within. Ignored when used with a block.

Examples

Plain content block

Input
<%= f7_content_block do %>
	Some content.
<% end %>
Output
<div class="content-block">
	Some content.
</div>

Content block + title

Input
<%= f7_content_block 'The Title' do %>
    Some more content
<% end %>

or

<%= f7_content_block :title => 'The Title' do %>
    Some more content
<% end %>
Output
<div class="content-block-title">The Title</div>
<div class="content-block">
    Some more content
</div>

Inset content block

Input
<%= f7_content_block :format => :inset do %>
    Inset content
<% end %>
Output
<div class="content-block inset">
    Inset content
</div>

Inner, tablet-inset content block

Input
<%= f7_content_block :format => :inner do %>
    Very in content
<% end %>
Output
<div class="content-block tablet-inset">
</div>