Stream: community

Topic: โœ” How to change popover preview thumbnail image size?


view this post on Zulip Hansen Zhang (Nov 22 2024 at 15:06):

I have been trying to change the popover preview image size. The default value is 400 as shown here :data-content="<img src="/api/access/datafile/3?imageThumb=400", but I could not find a place to change it in the CSS files. Is it possible to change this value to 800?
Thanks in advance for your help!

view this post on Zulip Philip Durbin ๐Ÿš€ (Nov 22 2024 at 16:04):

Have you tried /api/access/datafile/3?imageThumb=800?

view this post on Zulip Hansen Zhang (Nov 22 2024 at 16:10):

I have checked the css files and did not find the place to make the change. Here is where the element lives:
div class="media-object thumbnail-block text-center">
<span data-toggle="popover" data-template="<div class="popover thumb-preview" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>" data-placement="auto top" data-content="<img src="/api/access/datafile/3?imageThumb=400" alt="Preview: 277.jpg" />" data-trigger="hover" class="file-thumbnail-preview-img" data-html="true" data-original-title="" title=""><img id="datasetForm:tabView:filesTable:1:j_idt1317" src="/api/access/datafile/3?imageThumb=true&pfdrid_c=true" alt="277.jpg"></span>
</div>

view this post on Zulip Philip Durbin ๐Ÿš€ (Nov 22 2024 at 16:22):

Is it here?

src=&#34;/api/access/datafile/#{fileMetadata.dataFile.id}?imageThumb=400&#34;

https://github.com/IQSS/dataverse/blob/v6.4/src/main/webapp/file-info-fragment.xhtml#L33C131-L33C208

view this post on Zulip Hansen Zhang (Nov 22 2024 at 16:26):

Yes, that's it. But changing it to imageThumb=800 in the file-info-fragment.xhtml file only made the image background bigger, and did not change the image size.

view this post on Zulip Philip Durbin ๐Ÿš€ (Nov 22 2024 at 16:26):

oh

view this post on Zulip Philip Durbin ๐Ÿš€ (Nov 22 2024 at 16:27):

Sorry, JSF and frontend stuff generally is not a strength of mine.

view this post on Zulip Hansen Zhang (Nov 22 2024 at 16:31):

Thank you for your time and help any way! You have saved me many times.

view this post on Zulip Philip Durbin ๐Ÿš€ (Nov 22 2024 at 16:38):

No worries. Do you think the new React frontend will need the same change? The code is at https://github.com/IQSS/dataverse-frontend and it's deployed to https://beta.dataverse.org/spa

view this post on Zulip Hansen Zhang (Nov 22 2024 at 17:19):

It works the same way. Changing it to 800 in the inspector double the size.

view this post on Zulip Philip Durbin ๐Ÿš€ (Nov 22 2024 at 17:24):

Ok but are you happy with 400 in the new frontend? Should it be configurable?

view this post on Zulip Hansen Zhang (Nov 22 2024 at 17:35):

One of our users requested to have bigger image for preview. It would be nice to make it configurable.

view this post on Zulip Philip Durbin ๐Ÿš€ (Nov 22 2024 at 17:48):

Ok. Please feel free to open an issue at https://github.com/IQSS/dataverse-frontend

view this post on Zulip Hansen Zhang (Nov 22 2024 at 18:28):

Done. Thanks! Have a great weekend and a very happy Thanksgiving!

view this post on Zulip Philip Durbin ๐Ÿš€ (Nov 22 2024 at 18:46):

https://github.com/IQSS/dataverse-frontend/issues/555 looks great. Thanks! You too!

view this post on Zulip Notification Bot (Dec 05 2024 at 14:18):

Henning Timm has marked this topic as resolved.


Last updated: Nov 01 2025 at 14:11 UTC