Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Refinery CMS and twitterbootstrap
<%
# Collect the root items.
# ::Refinery::Menu is smart enough to remember all of the items in the original collection.
if (roots = local_assigns[:roots] || (collection ||= refinery_menu_pages).roots).present?
dom_id ||= 'menu'
css = [(css || 'menu clearfix')].flatten.join(' ')
hide_children = Refinery::Core.menu_hide_children if hide_children.nil?
-%>
<div class="navbar-inner">
<div class="container-fluid">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<%= link_to Refinery::Core.site_name, refinery.root_path, :class => 'brand' %>
<div class="nav-collapse collapse">
<ul class="nav">
<%= render :partial => '/refinery/menu_branch', :collection => roots,
:locals => {
:hide_children => hide_children,
:sibling_count => (roots.length - 1),
:menu_levels => local_assigns[:menu_levels],
:apply_css => true #if you don't care about class='first' class='last' or class='selected' set apply_css to false for speed.
} -%>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<% end -%>
/*
=require twitter-bootstrap-static/bootstrap
Use Font Awesome icons (default)
To use Glyphicons sprites instead of Font Awesome, replace with "require twitter-bootstrap-static/sprites"
=require twitter-bootstrap-static/fontawesome
*/
@media (min-width: 980px) {
body {
padding-top: 85px;
}
.sitebar.navbar.navbar-fixed-top {
top: 40px;
}
}
@media (max-width: 979px) {
.navbar-fixed-top {
margin-bottom: 0px;
}
}
//config/initializers/refinery/core.rb
# CSS class selectors for menu helper
config.menu_css = {:selected=>"active", :first=>"first", :last=>"last"}
<div class="span8">
<%=raw @page.content_for(:body) %>
</div>
<div class="span4">
<%=raw @page.content_for(:side_body) %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.