Esri / geoportal-server-catalog

Esri Geoportal Server is a next generation open-source metadata catalog and editor, based on elasticsearch.
https://www.esri.com/en-us/arcgis/products/geoportal-server/overview
Apache License 2.0
97 stars 60 forks source link

How to style the metadata popup when viewing a metadata record? #456

Closed karbah-geodata closed 2 years ago

karbah-geodata commented 2 years ago

I was curious if there's a functionality to style the contents of the metadata popup when clicking one of the results? Right now, when you click a search result you only get a popup containing barebones HTML structure of the metadata, which isn't the easiest or nicest way to explore the metadata.

If there's no builtin way, is there any hack one could apply, either by defining a custom css somewhere, or by defining the code that eventually builds and displays the html popup? I did notice the html entries are not structured in an easily manipulative way (eg few divs, no classes), so css styling might be a bit difficult.

mhogeweg commented 2 years ago

hi, this is possible by updating the XSLT that are applied to transform the metadata XML into an HTML view. Check out the content of this folder: https://github.com/Esri/geoportal-server-catalog/tree/master/geoportal/src/main/resources/metadata/details. You'll see a couple XSLT there.

The second part of this is to associate your new XSLT to the metadata of your type (ISO, FGDC, DC, ...). In the main evaluator you will find the metadata types defined. The definition includes a detailsXslt property that points to the xslt file in the above folder. This association done in https://github.com/Esri/geoportal-server-catalog/blob/master/geoportal/src/main/resources/metadata/js/Evaluator.js.

karbah-geodata commented 2 years ago

Perfect, I'll try that out, thanks!