Embedding Geonetwork on another site

Hello,

is it possible to embed the Geonetwork search form in external site?
For example a Wordpress site?

Regards, Tommaso

Hi Tommaso,

Yes geonetwork-ui provides a bunch of web components for that regard.

Look at this exemple of Geo2France which uses the search input in their CMS home page : Géo2France - Site public

The list of available web components : Webcomponents

If you want more advanced needs, it would require to create a new webcomponent for that, gnui components are not automatically exported as web components.

Good luck.

Is it possible to set a filter for suggestions from the <gn-search-input> component, e.g. filter=“{‘groupOwner’:{‘20’:true}}”?

This could be useful for limiting suggestions from the geocat.ch API to organisations or other specific criteria.

Hi,

To do this you’d need to define a sub-portal in your GeoNetwork instance using this filter [1] and target this sub-portal instead of the main catalogue when giving the API URL to the web component.

[1] https://docs.geonetwork-opensource.org/4.4/administrator-guide/configuring-the-catalog/portal-configuration/#creating-a-sub-portal-for-partners

Hi,

Thanks for your reply.

This is what I tried to do: I set the component’s `api-url attribute to point to this sub-portal. However, the resulting URL is not correctly constructed, which lead to the following error:

Suggestions cannot be retrieved Http failure response for geocat.ch 0 Unknown Error

For reference, I’m using the web component via the script:
https://cdn.jsdelivr.net/gh/geonetwork/geonetwork-ui@wc-dist-v2.6.1/gn-wc.js`

If you have any advice or know how to resolve this issue, I’d appreciate your help.

Could you please show how you’re setting up the web component?

Yes, of course, here it is.

Right, so I guess targeting a different sub-portal named mypartner would be done like so:

        <gn-search-input
          api-url="https://geocat-int.dev.bgdi.ch/geonetwork/mypartner/api"
          open-on-search="https://geocat-int.dev.bgdi.ch/datahub/search?organization=Canton%20du%20Valais&q=${search}"
          open-on-select="https://geocat-int.dev.bgdi.ch/datahub/dataset/${uuid}"
        ></gn-search-input>

But I see now that this could be a bit awkward because ideally another Datahub interface would be set up for this specific partner.

If you think that having a way to specify a “built-in filter” for the web components would be valuable, please open an issue on the Github repo explaining your needs and how you think they could be addressed. Thank you!

1 Like