diff --git a/app/components/ngao/arclight/search_result_breadcrumbs_component.html.erb b/app/components/ngao/arclight/search_result_breadcrumbs_component.html.erb new file mode 100644 index 0000000..0aba771 --- /dev/null +++ b/app/components/ngao/arclight/search_result_breadcrumbs_component.html.erb @@ -0,0 +1,13 @@ +<%# + OVERRIDE Arclight v1.4.0 to check if the rendered breadcrumbs is an empty html tag +%> + +
Collection Context
+ +<% if rendered_breadcrumbs.include? 'breadcrumb-item' %> +
+ +
+<% end %> diff --git a/app/components/ngao/arclight/search_result_breadcrumbs_component.rb b/app/components/ngao/arclight/search_result_breadcrumbs_component.rb new file mode 100644 index 0000000..c1028d3 --- /dev/null +++ b/app/components/ngao/arclight/search_result_breadcrumbs_component.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module Ngao + module Arclight + class SearchResultBreadcrumbsComponent < ::Arclight::SearchResultBreadcrumbsComponent + end + end +end diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 279f7f8..d41d624 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -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: {