Skip to content

Commit

Permalink
Merge pull request #2762 from sul-dlss/2761-search-bar
Browse files Browse the repository at this point in the history
Do not render exhibit navbar if exhibit has configured search bar to not display
  • Loading branch information
jcoyne authored Dec 18, 2024
2 parents e8c88ad + 10cead0 commit c1bb9e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 9 additions & 11 deletions app/components/exhibit_navbar_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<div id="site-navbar" class="site-navbar mt-auto py-2">
<% if helpers.should_render_spotlight_search_bar? %>
<div class="container d-flex flex-wrap">
<%= render search_component.new(
url: helpers.search_action_url,
advanced_search_url: helpers.search_action_url(action: 'advanced_search'),
params: helpers.search_state.params_for_search.except(:qt),
autocomplete_path: suggest_index_catalog_path
) %>
<%= render SearchTipsLinkComponent.new %>
</div>
<% end %>
<div class="container d-flex flex-wrap">
<%= render search_component.new(
url: helpers.search_action_url,
advanced_search_url: helpers.search_action_url(action: 'advanced_search'),
params: helpers.search_state.params_for_search.except(:qt),
autocomplete_path: suggest_index_catalog_path
) %>
<%= render SearchTipsLinkComponent.new %>
</div>
</div>
3 changes: 3 additions & 0 deletions app/components/exhibit_navbar_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

# Overrides Spotlight ExhibitNavbarComponent and provides Search Tips link
class ExhibitNavbarComponent < Spotlight::ExhibitNavbarComponent
def render?
helpers.should_render_spotlight_search_bar?
end
end

0 comments on commit c1bb9e5

Please sign in to comment.