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

Seeking clarification of functionality & configuration #31

Open
kayakr opened this issue Dec 5, 2024 · 0 comments
Open

Seeking clarification of functionality & configuration #31

kayakr opened this issue Dec 5, 2024 · 0 comments

Comments

@kayakr
Copy link

kayakr commented Dec 5, 2024

Thank you for sharing this module. I have it working but I needed to change a few things:

  1. From https://github.com/discoverygarden/dgi_image_discovery/blob/main/README.md?plain=1#L70 "Create a media item of type Image" suggested to me that a Image media type would be required, and that's what seems to be referenced in https://github.com/discoverygarden/dgi_image_discovery/blob/main/src/Plugin/search_api/processor/DgiImageDiscovery.php#L170 but the install hook dgi_image_discovery_update_8001() creates an Image field referencing a file not a media type.
    I needed to alter src/Plugin/search_api/processor/DgiImageDiscovery.php with:
171,176d170
<         if ($media instanceOf File) {
<           $uri = $media->getFileUri();
<           if ($uri) {
<             return $image_style->buildUrl($media->getFileUri());
<           }
<         }
  1. Once I had dgi_image_discovery field added to the Solr index, the README.md suggests adding the virtual field "DGI Image Discovery Discovered Image" https://github.com/discoverygarden/dgi_image_discovery/blob/main/README.md?plain=1#L77 but that field is from Content datasource not the indexed field. I added "DGI Image Discovery" field to get URL from dgi_image_discovery in the search index, but then need to wrap that to become a thumbnail image, e.g. Rewrite results, "Override the output of this field with custom text", set Text=<img src="{{ dgi_image_discovery }}"/>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant