Skip to content

Commit

Permalink
Merge pull request #633 from IU-Libraries-Joint-Development/essi-2025…
Browse files Browse the repository at this point in the history
…_campus_facet_display

[ESSI-2025] campus facet display
  • Loading branch information
rwingiupui authored Nov 14, 2024
2 parents 42a4f3d + ec5a965 commit ad5b4c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions app/helpers/facet_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@ module FacetHelper
def campus_label(value)
CampusService.find(value)[:term] || ''
end

# campus-specific version of link_to_facet
# @param item [Object]
# @param field [String]
# @return [ActiveSupport::SafeBuffer] the html_safe link
def link_to_campus_facet(item, field)
path = main_app.search_catalog_path(search_state.add_facet_params_and_redirect(field, item))
item = campus_label(item)
link_to(item, path)
end
end
2 changes: 1 addition & 1 deletion app/views/records/show_fields/_campus.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<span itemprop="campus"><%= link_to_facet(record.campus, Solrizer.solr_name("campus", :facetable)) %></span><br />
<span itemprop="campus"><%= link_to_campus_facet(record.campus, Solrizer.solr_name("campus", :facetable)) %></span><br />

0 comments on commit ad5b4c0

Please sign in to comment.