gbif / hosted-portals

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

Custom routing #217

Closed MortenHofft closed 2 years ago

MortenHofft commented 2 years ago

I also have a related question :-) In the occurrence view in the portal, the occurrence has a link to the gbif dataset page. Since we have our own dataset pages in the living-norway portal, we would like to link to our own dataset page from the slide-in drawer. Is there a way to to that or could that be a possibility in the future?

Originally posted by @siwelisabeth in https://github.com/gbif/hosted-portals/issues/203#issuecomment-1041285098

MortenHofft commented 2 years ago

Hi You can control the routes. Update your config to something like:

var siteConfig = {
  routeConfig: {
    datasetKey: {
      url: ({key}) => `/dataset?key=${key}`,
      isHref: true
    },
  },
  occurrence: {
    rootPredicate: { type: 'equals', key: 'publishingOrg', value: "46fec380-8e1d-11dd-8679-b8a03c50a862" }
  }
};
siwelisabeth commented 2 years ago

After the change in configuration: https://github.com/gbif/hosted-portals/issues/221 How can we configure that the links to the dataset page go to our portal page instead of gbif?

MortenHofft commented 2 years ago

Just leave it as is. It will work by tomorrow or before. I'm doing a fairly large refactoring across 3 projects. My focus is on not disturbing prod sites. Your development environment (staging) will have routing back to normal shortly. I believe your dataset search works as normal, but the links elsewhere might still be odd. Sorry about that.

MortenHofft commented 2 years ago

Your site is back to normal @siwelisabeth

siwelisabeth commented 2 years ago

Great, thank you very much :-)