Pergunta

I just starting using Refinery and I am trying to add my clients logo in the navbar so it acts as the home page link but can't figure out how I could accomplish this. This is what I have so far:

application.html.erb

<header id="header">
   <%= render "/refinery/header" -%>
</header>

_header.html.erb

 <%= zurb_menu.to_html %>

application_helper.rb

module ApplicationHelper
  def zurb_menu
  menu_items = Refinery::Menu.new(Refinery::Page.fast_menu)

  presenter = Refinery::Pages::MenuPresenter.new(menu_items, self)
  presenter.css = "top-bar-section"
  presenter.dom_id = nil
  presenter.menu_tag = :section
  presenter.list_tag = "ul class='left'"
  presenter
 end
end
Foi útil?

Solução

Adding it to Application Helper and calling in your _header.html.erb is the actual way of implementing.

Instead if you wanted to do it without risk, you can directly include the logo by editing the application.html.erb and adding the

<img style="" src="/system/images/Wsdsds/logo.png"/>

before or after

<%= render "/refinery/header" -%>

as you wish and this will be shown to every page where the header id refers. Similarly you can overwrite any view files.

In case, if the _header.html.erb is invisible you can easily make it visible by using the refinery override,

$ rake refinery:override view=refinery/*

Outras dicas

Typically you'd put a logo helper in your Application helper

def logo
    image_tag("some_graphic.png",
      :alt => ::Refinery::Setting.find_or_set(:site_name, "Project Name"))
end

and call it in your _header.html.erb partial

<div id='logo'>
  <%= link_to logo, refinery.root_path%>
</div>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top