Skip to content

Commit

Permalink
🐛 Add check to prevent displaying blank metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaLMoore committed Oct 21, 2024
1 parent b6ea0cf commit e548cd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/views/catalog/_index_list_default.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<%# OVERRIDE Hyrax 5.0.1 to enable markdown for index field values in search results %>
<%# OVERRIDE Hyrax 5.0.1 to handle search only accounts %>
<%# OVERRIDE Hyrax 5.0.1 display label only when a property has a value, to prevent blank metadata %>

<div class="ol-md-9 col-lg-6">
<div class="metadata">
<dl>
<% doc_presenter = index_presenter(document) %>
<% index_fields(document).each do |field_name, field| -%>
<% if should_render_index_field? document, field %>
<% field_value = doc_presenter.field_value(field) %>
<% if should_render_index_field?(document, field) && field_value.present? %>
<div class="row">
<dt class="col-5 text-right" data-solr-field-name="<%= field_name %>"><%= render_index_field_label document, field: field_name %></dt>
<dd class="col-7"><%= markdown(doc_presenter.field_value field) %></dd>
Expand Down

0 comments on commit e548cd2

Please sign in to comment.