Sidebar Yields

‹ Back

Sidebar

You can throw things in to a sidebar layout by using the :sidebar yield:

Content
Panel in sidebar
<div class="page__with-sidebar">
  <div class="page--main">
    Content
  </div>
  <div class="page--sidebar">
    <div class="panel panel__passive">
      Panel in sidebar
    </div>
  </div>
</div>
<%- content_for :sidebar do -%>
  <div class="panel panel__passive">
    Panel in sidebar
  </div>
<%- end -%>

Content

Sidebar right

You can put the content on the right by changing the yield to :sidebar_right.

Content
Panel in sidebar
<div class="page__with-sidebar-right">
  <div class="page--main">
    Content
  </div>
  <div class="page--sidebar">
    <div class="panel panel__passive">
      Panel in sidebar
    </div>
  </div>
</div>
<%- content_for :sidebar_right do -%>
  <div class="panel panel__passive">
    Panel in sidebar
  </div>
<%- end -%>

Content