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

f7_page - Page Container

This renders the container that holds a page for an application.

Usage

f7_page options, &block

Supported options

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

  • :layout - Optional, allows you specify a layout to render a page partial within. Ignored when used with a block.

  • :padding - Optional, specify top and bottom offsets in an array. They are both optional.

    1. For a navbar, use one of the following:
      • :no_navbar
      • :navbar
    2. For a toolbar/tabbar, use one of the following:
      • :no_toolbar
      • :tabbar_labels
      • :toolbar

    The precedence for the two :padding options is shown above. Only the first match will be kept.

When you specify :no_navbar or :no_toolbar the navbar of that page to be rendered empty, regardless of content.

Examples

With a block

Input
<%= f7_page :home, :padding => :tabbar_labels do %>
    <!-- Other Content -->
<% end %>
Output
<div class="page navbar-fixed" data-page="home">
    <div class="page-content">
        <!-- Other Content -->
    </div>
</div>

Without a block

If you choose not to pass a block along with this helper it will attempt to load a partial as follows:

app/views/<controller>/<view>/<page>

For example, if you have a WelcomeController view containing the following markup:

<%= f7_views do %>
    <%= f7_view :main do %>
        <%= f7_pages :navbar => :through do %>
            <%= f7_page :home %>

It will try and load the partial app/views/welcome/main/home, obeying the normal rules for file extensions, etc. failing if it cannot be found.


Framework7 Documentation

Page

Clone this wiki locally