gbif / hosted-portals

Support material for establishing the GBIF Hosted Portals
Apache License 2.0
10 stars 6 forks source link

Support for Multiple Data Scopes in a Single Hosted Portal #292

Closed MichalTorma closed 3 months ago

MichalTorma commented 3 months ago

Hello,

I have a question regarding the configuration of data scopes in a GBIF hosted portal. Specifically, I would like to know if it is possible to configure a single hosted portal to use multiple data scopes simultaneously.

In my case, I am interested in displaying data published in a certain country as well as data published by a certain country within the same portal.

Is this feature supported, and if so, could you provide some guidance on how to set it up?

Thank you for your assistance!

MortenHofft commented 3 months ago

I'm not entirely sure it would work actually. It might.

You can provide different configs to the components. The point where I'm not entirely certain, without digging into the code or trying it, is with the routes. Also I'm not sure what behaviour you would want.

Version 1: You simply have a scope that encompass both countries, and then simply link to a filter with that country (say a menu item with a linke to occurrence/search?country=NO - that would technically be the same as all other sites, but it might not be the behaviour you want.

Version 2: You configure two occurrence search pages /occurrence_no/search/ and /occurrence_se/search with difference scopes. But then what is the url of the datasets they link to? /dataset/1234 - that won't work, because then those links will have always go to the same occurrence search. So then you end up with 2 dataset urls: /dataset_no/1234 and /dataset_se/1234. Similar for all other pages. Because all other pages need to know where the occurrence search is located. As they link to eachother. That seems a mess to me to include multiple url for all pages

Secondly I'm not entirely sure that I have properly accounted for it everywhere, so there might be bugs as well. But I'm more worried about the user experience router-mess of version 2.

But for adding multiple configs you could just mount the widgets manually. You own layout really copying the predefined ones that take the config from the config file

So if you created a file /_layouts/my-collection-searcy.htmlwith a content similar to https://github.com/gbif/jekyll-hp-base-theme/blob/master/_layouts/collection-search.html But just changed the config to something else you would have 2 collection search layouts to choose from

MortenHofft commented 3 months ago

What is it that you are trying to achieve in a bit more details?

MichalTorma commented 3 months ago

Thanks for the detailed response.

I’m leaning towards Version 1, where we have a single scope that includes both types of data (data published in the country and data published by the country). However, I’m a bit concerned about how the overall stats would work with this setup.

To give you more context, Slovakia is thinking about setting up a hosted portal and wants to show both:

1.  Data published by institutions in Slovakia.
2.  Data published within Slovak borders by other institutions.

Basically, we’re looking to do something similar to what’s already on the Slovakia page on gbif.org, with all the stats and maps for both categories of data.

MortenHofft commented 3 months ago

I would tend towards that as well.

You could have 2 links in the menu. One to data about and one to data from. But it would just be a filter that users could remove. Charts, maps etc within that would still work. About vs from

We have also recently added a prebuild way to add charts as a standard component on markdown pages. https://hp-theme.gbif-staging.org/layout/compose

So if you wanted a dedicated page about publishing effort, you could create an about.md and combine prose and charts to tell the story about the publication efforts. But we do not currently have a ready made aboutCountry layout that does it all. And we do not have a map chart at the moment, but I can see how that might be useful.

Data published within Slovak borders by other institutions.

Only showing data about Slovakia, that is NOT published by a Slovak publisher. I'm not sure we have a good way to do that at the moment. We can show data about the country, but we do not have a "not these publishers"-filter. Is this what you need or is it just "Data published within Slovak borders by ANY publisher"?

MichalTorma commented 3 months ago

We can show data about the country, but we do not have a "not these publishers"-filter. Is this what you need or is it just "Data published within Slovak borders by ANY publisher"?

Yeah - that is what I meant.

Alright then thanks for the reply, I'll give it a go once the shareholder decides what they want to go for :)