我在refinerycms中创建了一个引擎,将数据提取到主页上。 Refinerycms自动为该引擎创建一个页面和一个菜单项。如何从精炼厂菜单中删除特定的引擎页面和引擎菜单项?
我该如何删除引擎页面以及从菜单栏中删除它?
menu.html.erb
<%
# 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 id="nav">
<ul>
<%= 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>
<% end -%>
menu_branch.html.erb
<%
if !!local_assigns[:apply_css] and (classes = menu_branch_css(local_assigns)).any?
css = "class='#{classes.join(' ')}'".html_safe
end
-%>
<li<%= ['', css].compact.join(' ').gsub(/\ *$/, '').html_safe %>>
<%= link_to(menu_branch.title, refinery.url_for(menu_branch.url)) -%>
<% if ((children = menu_branch.children unless hide_children).present? &&
(!local_assigns[:menu_levels] || menu_branch.ancestors.length < local_assigns[:menu_levels])) -%>
<ul class='clearfix'>
<%= render :partial => '/refinery/menu_branch', :collection => children,
:locals => {
:apply_css => local_assigns[:apply_css],
:hide_children => !!hide_children,
:menu_levels => local_assigns[:menu_levels]
} -%>
</ul>
<% end -%>
</li>
,我想从菜单栏中删除尤其菜单项是 “新方案”
这是我正在寻找的确切答案。只需要将“博客”设置为默认页面并隐藏“主页”选项即可。 – JGallardo 2013-09-04 23:54:17
这会阻止它出现在菜单上,但它不会帮助您删除页面 - 例如如果你以某种方式意外地将数据库“播种”两次,并且现在有“博客”页面重复出现! – CJBrew 2013-12-15 16:49:34