Skip to content

Commit

Permalink
LIB-511 add linked collections field
Browse files Browse the repository at this point in the history
  • Loading branch information
bricas committed Apr 17, 2024
1 parent 5311094 commit 9afb887
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
9 changes: 9 additions & 0 deletions config-yml/search_api.index.eresources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ field_settings:
dependencies:
module:
- eresources
linked_collections:
label: 'Linked Collections'
datasource_id: 'entity:eresources_record'
property_path: linked_collections
type: text
dependencies:
module:
- eresources
metadata_local_access_information:
label: 'Local Metadata: Access Information'
datasource_id: 'entity:eresources_record'
Expand Down Expand Up @@ -302,6 +310,7 @@ processor_settings:
add_url: { }
aggregated_field: { }
auto_aggregated_fulltext_field: { }
custom_value: { }
entity_type: { }
language_with_fallback: { }
rendered_item: { }
Expand Down
19 changes: 19 additions & 0 deletions custom/modules/eresources/src/Entity/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,25 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
])
->setDisplayConfigurable('form', TRUE);

$fields['linked_collections'] = BaseFieldDefinition::create('string_long')
->setLabel(t('Linked Collections'))
->setRequired(FALSE)
->setSettings(
[
'default_value' => '',
'max_length' => 1024,
]
)
->setDisplayOptions('form', [
'type' => 'string_textarea',
'weight' => 0,
'settings' => [
'rows' => 7,
'placeholder' => "Title,URL\nTitle,URL",
],
])
->setDisplayConfigurable('form', TRUE);

$fields['is_local'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Mark as a custom local record'))
->setDescription(t('A boolean indicating whether the Record is a custom local record.'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% set fields = [
'id', 'entry_uid', 'title', 'oclcnum', 'isbn', 'issn',
'eissn', 'url', 'author', 'publisher', 'coverage', 'coverageenum',
'coverage_notes', 'collection_user_notes', 'location',
'coverage_notes', 'collection_user_notes', 'location', 'linked_collections',
'kb_data_type', 'status',
] %}
{% for field in fields %}
Expand Down

0 comments on commit 9afb887

Please sign in to comment.