Stream: troubleshooting

Topic: ✔ hiding/collapsing Dataverses accordion in advanced search


view this post on Zulip maría a. matienzo (Jul 12 2024 at 00:26):

we're interested in hiding the Dataverses accordion on the advanced search page. at this point, we're only planning to have only one dataverse within our instance. does anyone have any recommendations about how we might approach this?

view this post on Zulip Oliver Bertuch (Jul 12 2024 at 07:24):

Hi there and welcome to the community! I'm not sure what you are referring to. Could you create some screenshots, maybe hidding things you don't want using CSS in your browser's dev tools?

view this post on Zulip Philip Durbin 🚀 (Jul 12 2024 at 14:22):

@María A. Matienzo hi! You might be able to add a custom footer ( https://guides.dataverse.org/en/6.3/installation/config.html#custom-footer ) and include some JavaScript you write to collapse that part of the Advanced Search page.

view this post on Zulip Philip Durbin 🚀 (Jul 12 2024 at 14:26):

@Oliver Bertuch the accordion in question is the collection ("Dataverses") one at the top: https://github.com/IQSS/dataverse/blob/v6.3/src/main/webapp/search/advanced.xhtml#L39

view this post on Zulip maría a. matienzo (Jul 12 2024 at 18:18):

@Philip Durbin thank you! i was able to this in the custom footer:

$(document).ready(function() {
  ('#panelCollapseDataversesFieldList').collapse();
});

view this post on Zulip Philip Durbin 🚀 (Jul 12 2024 at 18:19):

That was fast! Great! :tada:

view this post on Zulip maría a. matienzo (Jul 12 2024 at 18:19):

there are some fiddly parts about the element rendering before the collapse event fires, but some of that can be mitigated with additional CSS.

view this post on Zulip Notification Bot (Jul 12 2024 at 18:20):

María A. Matienzo has marked this topic as resolved.

view this post on Zulip maría a. matienzo (Jul 12 2024 at 18:24):

by comparison, if one wanted to hide that part of the form fully, you could do something like this in CSS as @Oliver Bertuch suggested:

div.panel:has(> #panelCollapseDataversesFieldList) {
    display: none;
}

Last updated: Oct 30 2025 at 06:21 UTC