gbif / gbif-web

Apache License 2.0
6 stars 9 forks source link

Ensure flexible routing and option to mount single pages #602

Closed MortenHofft closed 1 month ago

MortenHofft commented 5 months ago

A use case is a site that have multiple versions of occurrence search running under different urls with different filters. And options to control the url of the individual occurrence records (writting custom occurrence detail pages)

MortenHofft commented 5 months ago

So an example is a hosted portal that has two occurrence search with different scopes. One for all of Denmark: country=DK and one for danish birds: taxonKey:212 AND country=DK

One occurrence search would have to be designated as the primary I think. Else it isn't clear where an occurrence search link from e.g. a dataset page would go to.

We have had this request.

danielvdm2000 commented 1 month ago

There is now a new config option used to add multiple occurrence search pages.

An example of one extra occurrence search page:

extraOccurrenceSearchPages: [
          {
            path: 'danish-occurrence/search',
            overwriteConfig: {
              occurrencePredicate: {
                type: 'and',
                predicates: [
                  {
                    type: 'equals',
                    key: 'countryCode',
                    value: 'DK',
                  },
                ],
              },
            },
          },
        ],

This has also been added to the hosted portal demo within the gbif-org project.