Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♿️ Don't render an empty breadcrumb element #77

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<%#
OVERRIDE Arclight v1.4.0 to check if the rendered breadcrumbs is an empty html tag
%>

<dt class="visually-hidden">Collection Context</dt>

<% if rendered_breadcrumbs.include? 'breadcrumb-item' %>
<dd>
<div class='breadcrumb-links'>
<%= rendered_breadcrumbs %>
</div>
</dd>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Ngao
module Arclight
class SearchResultBreadcrumbsComponent < ::Arclight::SearchResultBreadcrumbsComponent
end
end
end
3 changes: 2 additions & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ class CatalogController < ApplicationController
config.add_index_field 'abstract_or_scope', accessor: true, truncate: true, repository_context: true,
helper_method: :render_html_tags,
component: Arclight::IndexMetadataFieldComponent
config.add_index_field 'breadcrumbs', accessor: :itself, component: Arclight::SearchResultBreadcrumbsComponent,
config.add_index_field 'breadcrumbs', accessor: :itself,
component: Ngao::Arclight::SearchResultBreadcrumbsComponent,
compact: { count: 2 }

config.add_facet_field 'access', query: {
Expand Down
Loading