From 5722a12100e655f17f6822a92e879a8e9c38613e Mon Sep 17 00:00:00 2001 From: Mark Jordan Date: Mon, 22 Apr 2024 08:34:53 -0700 Subject: [PATCH 01/11] Adds instructions on how to add field_representative_image to a content type. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 264c02a..90a9451 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,19 @@ collections, compounds and paged objects. ## Configuration +### Adding the field to your content type + +You will need to add a new field to each of your applicable content types. To do this: + +1. In the "Manage fields" page for your content type, choose "Create a new field". +1. In the "Add a new field" list, choose "Reference > Media". +1. Since the machine name of this field must be `field_representative_image`, you will need to give the new field the lable "Representative image" when you create it. You can can change this label later if you wish. +1. On the next page, in the "Type of item to reference" setting, choose "Media" and leave the "Allowed number of values" at 1. +1. On the next page, in the "Media type" checkboxes, choose "Image". +1. Click on "Save settings". + +### Using the image in Views + When configuring a content view, add and configure the virtual field "DGI Image Discovery Discovered Image". From 46ed8de0281d5e28e077d8e72a5167223b8aee8f Mon Sep 17 00:00:00 2001 From: Mark Jordan Date: Mon, 22 Apr 2024 08:37:51 -0700 Subject: [PATCH 02/11] Added clarification on re-using field. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 90a9451..9435a6a 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ You will need to add a new field to each of your applicable content types. To do 1. On the next page, in the "Media type" checkboxes, choose "Image". 1. Click on "Save settings". +If you are adding the field to more than one content type, you should choose "Re-use an existing field" on subsequent content types. + ### Using the image in Views When configuring a content view, add and configure the virtual field From b9ebe22111e1c2945fdf834fbaad968ec6c20475 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Mon, 22 Apr 2024 13:38:16 -0300 Subject: [PATCH 03/11] edit the field-adding instructions, and include how the module discovers. --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9435a6a..cb8d89e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,12 @@ ## Introduction -A module to facilitate image discovery for Islandora repository items. +A module to facilitate image discovery for Islandora repository items. Image discovery looks for images in the following places and will use the first one found: + +* contents of a Media field, `field_representative_image` on the node +* a thumbnail media, i.e., a media that is "Member of" the node (using `field_member_of`) with a Media Use (`field_media_use`) taxonomy term with External URI (`field_external_uri`) equal to "http://pcdm.org/use#ThumbnailImage" +* a first child's thumbnail media, i.e. a thumbnail media of the node with lowest weight (`field_weight`) that is a Member Of (`field_member_of`) the node in question. If not found on the first direct child, it will look at the first child's first child, and so forth to a depth of 3. + ## Requirements @@ -23,13 +28,13 @@ collections, compounds and paged objects. ## Configuration -### Adding the field to your content type +### Adding a "Representative Image" field to your content type -You will need to add a new field to each of your applicable content types. To do this: +To override the discovered thumbnail, you can add a new field to each of your applicable content types. To do this: 1. In the "Manage fields" page for your content type, choose "Create a new field". 1. In the "Add a new field" list, choose "Reference > Media". -1. Since the machine name of this field must be `field_representative_image`, you will need to give the new field the lable "Representative image" when you create it. You can can change this label later if you wish. +1. Set the new field's label to "Representative image" so that the machine name of this field is `field_representative_image`. This machine name must be set; you can change the label later if you wish. 1. On the next page, in the "Type of item to reference" setting, choose "Media" and leave the "Allowed number of values" at 1. 1. On the next page, in the "Media type" checkboxes, choose "Image". 1. Click on "Save settings". From 84d2314c2c768e3d8649a4eade3282863863061a Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Mon, 22 Apr 2024 13:49:24 -0300 Subject: [PATCH 04/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cb8d89e..65cb9f8 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ collections, compounds and paged objects. ### Adding a "Representative Image" field to your content type -To override the discovered thumbnail, you can add a new field to each of your applicable content types. To do this: +To override the use of the "Islandora" thumbnail, you can add a new field to each of your applicable content types. To do this: 1. In the "Manage fields" page for your content type, choose "Create a new field". 1. In the "Add a new field" list, choose "Reference > Media". From 4989c192302722ecc4b9b90d4d8ccbbaa4a674e5 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Mon, 22 Apr 2024 13:50:40 -0300 Subject: [PATCH 05/11] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 65cb9f8..d1c3c53 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ A module to facilitate image discovery for Islandora repository items. Image discovery looks for images in the following places and will use the first one found: * contents of a Media field, `field_representative_image` on the node -* a thumbnail media, i.e., a media that is "Member of" the node (using `field_member_of`) with a Media Use (`field_media_use`) taxonomy term with External URI (`field_external_uri`) equal to "http://pcdm.org/use#ThumbnailImage" -* a first child's thumbnail media, i.e. a thumbnail media of the node with lowest weight (`field_weight`) that is a Member Of (`field_member_of`) the node in question. If not found on the first direct child, it will look at the first child's first child, and so forth to a depth of 3. +* an "Islandora thumbnail", i.e., a media that is "Member of" the node (using `field_member_of`) with a Media Use (`field_media_use`) taxonomy term with External URI (`field_external_uri`) equal to "http://pcdm.org/use#ThumbnailImage" +* a first child's Islandora thumbnail media, i.e. the Islanodra thumbnail of the node with lowest weight (`field_weight`) that is a Member Of (`field_member_of`) the node in question. If not found on the first direct child, it will look at the first child's first child, and so forth to a depth of 3. ## Requirements From fb19a735ec0b836e01924b33ef7a74e44e31fd99 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Mon, 22 Apr 2024 16:13:01 -0300 Subject: [PATCH 06/11] Update for Drupal 10.3, Media field type is no longer nested under Reference. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d1c3c53..7495dd3 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ collections, compounds and paged objects. To override the use of the "Islandora" thumbnail, you can add a new field to each of your applicable content types. To do this: 1. In the "Manage fields" page for your content type, choose "Create a new field". -1. In the "Add a new field" list, choose "Reference > Media". +1. In the "Add a new field" list, choose "Media" (if on Drupal < 10.3, this is "Reference > Media" 1. Set the new field's label to "Representative image" so that the machine name of this field is `field_representative_image`. This machine name must be set; you can change the label later if you wish. 1. On the next page, in the "Type of item to reference" setting, choose "Media" and leave the "Allowed number of values" at 1. 1. On the next page, in the "Media type" checkboxes, choose "Image". From 641edfebc2d5b601bf80c49b55fd5eda98815fd5 Mon Sep 17 00:00:00 2001 From: Mark Jordan Date: Thu, 25 Apr 2024 11:53:12 -0700 Subject: [PATCH 07/11] Update README.md - added missing closing parenthesis --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7495dd3..2f04b5b 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ collections, compounds and paged objects. To override the use of the "Islandora" thumbnail, you can add a new field to each of your applicable content types. To do this: 1. In the "Manage fields" page for your content type, choose "Create a new field". -1. In the "Add a new field" list, choose "Media" (if on Drupal < 10.3, this is "Reference > Media" +1. In the "Add a new field" list, choose "Media" (if on Drupal < 10.3, this is "Reference > Media") 1. Set the new field's label to "Representative image" so that the machine name of this field is `field_representative_image`. This machine name must be set; you can change the label later if you wish. 1. On the next page, in the "Type of item to reference" setting, choose "Media" and leave the "Allowed number of values" at 1. 1. On the next page, in the "Media type" checkboxes, choose "Image". From 1b1f1acb92f2318bc509967ece5aa6df1dfcf5ad Mon Sep 17 00:00:00 2001 From: Mark Jordan Date: Thu, 25 Apr 2024 12:38:16 -0700 Subject: [PATCH 08/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f04b5b..ff2460f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ collections, compounds and paged objects. To override the use of the "Islandora" thumbnail, you can add a new field to each of your applicable content types. To do this: 1. In the "Manage fields" page for your content type, choose "Create a new field". -1. In the "Add a new field" list, choose "Media" (if on Drupal < 10.3, this is "Reference > Media") +1. In the "Add a new field" list, choose "Media" (if on Drupal < 10.2, this is "Reference > Media") 1. Set the new field's label to "Representative image" so that the machine name of this field is `field_representative_image`. This machine name must be set; you can change the label later if you wish. 1. On the next page, in the "Type of item to reference" setting, choose "Media" and leave the "Allowed number of values" at 1. 1. On the next page, in the "Media type" checkboxes, choose "Image". From 92a5784a5e0f9cf63d2e0fab0ba69b071634a270 Mon Sep 17 00:00:00 2001 From: Mark Jordan Date: Thu, 25 Apr 2024 13:15:56 -0700 Subject: [PATCH 09/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ff2460f..1a3bde8 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A module to facilitate image discovery for Islandora repository items. Image discovery looks for images in the following places and will use the first one found: * contents of a Media field, `field_representative_image` on the node -* an "Islandora thumbnail", i.e., a media that is "Member of" the node (using `field_member_of`) with a Media Use (`field_media_use`) taxonomy term with External URI (`field_external_uri`) equal to "http://pcdm.org/use#ThumbnailImage" +* an "Islandora thumbnail", i.e., a media that is "Media of" the node (using `field_media_of`) with a Media Use (`field_media_use`) taxonomy term with External URI (`field_external_uri`) equal to "http://pcdm.org/use#ThumbnailImage" * a first child's Islandora thumbnail media, i.e. the Islanodra thumbnail of the node with lowest weight (`field_weight`) that is a Member Of (`field_member_of`) the node in question. If not found on the first direct child, it will look at the first child's first child, and so forth to a depth of 3. From a193ba0bd7f4e3cb76c07484fc9be19ca13bd2d4 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Thu, 25 Apr 2024 17:17:19 -0300 Subject: [PATCH 10/11] islanODra fix. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a3bde8..cbd2a81 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A module to facilitate image discovery for Islandora repository items. Image dis * contents of a Media field, `field_representative_image` on the node * an "Islandora thumbnail", i.e., a media that is "Media of" the node (using `field_media_of`) with a Media Use (`field_media_use`) taxonomy term with External URI (`field_external_uri`) equal to "http://pcdm.org/use#ThumbnailImage" -* a first child's Islandora thumbnail media, i.e. the Islanodra thumbnail of the node with lowest weight (`field_weight`) that is a Member Of (`field_member_of`) the node in question. If not found on the first direct child, it will look at the first child's first child, and so forth to a depth of 3. +* a first child's Islandora thumbnail media, i.e. the Islandora thumbnail of the node with lowest weight (`field_weight`) that is a Member Of (`field_member_of`) the node in question. If not found on the first direct child, it will look at the first child's first child, and so forth to a depth of 3. ## Requirements From f123049d637946c19d3b19e604281a4512bd0b8e Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Thu, 25 Apr 2024 17:22:58 -0300 Subject: [PATCH 11/11] Update README.md --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cbd2a81..abc790f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Introduction -A module to facilitate image discovery for Islandora repository items. Image discovery looks for images in the following places and will use the first one found: +A module to facilitate image discovery for Islandora repository items. Image discovery looks for images in the following places and will use (and cache) the first one found: * contents of a Media field, `field_representative_image` on the node * an "Islandora thumbnail", i.e., a media that is "Media of" the node (using `field_media_of`) with a Media Use (`field_media_use`) taxonomy term with External URI (`field_external_uri`) equal to "http://pcdm.org/use#ThumbnailImage" @@ -23,7 +23,7 @@ further information. ## Usage -This module allow for image discovery on parent aggregate objects such as +This module allows for image discovery on parent aggregate objects such as collections, compounds and paged objects. ## Configuration @@ -46,6 +46,11 @@ If you are adding the field to more than one content type, you should choose "Re When configuring a content view, add and configure the virtual field "DGI Image Discovery Discovered Image". +### Using the image in Content Display + +Under "Manage display" for a content type, you can enable the pseudo-field +"DGI Image Discovery Discovered Image". + ## Troubleshooting/Issues Having problems or solved a problem? Contact