gbif / hosted-portals

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

complex logicals for story blocks #281

Closed sformel-usgs closed 4 months ago

sformel-usgs commented 4 months ago

I followed the links you had sent me in a previous email about the story blocks, they were very helpful. However, I can't seem to get more than "data use" contentType to show up...

From @MortenHofft via email:

I know what the problem is. The filter countriesOfCoverage and countriesOfResearcher filters out the news stories, as no news has a value. I suppose ideally you should be able to do things like combining AND and ORs in a more complex manner (contentType=dataUse AND countriesOfCoverage=US) OR (contentType=News) A potential workaround for now could be to have multiple sections? 3 events. 3 news stories. 3 dataUse. ?

Could you please create an issue and describe what kind of options you need?

A single page that has three sections: news, events, and data use, would be sufficient. I tried to create it, but found that when I stacked story blocks, the last block populates the top block, and the other two are left blank. See: https://hp-bison.gbif-staging.org/stories_stacked/

I can make three separate pages:

  1. https://hp-bison.gbif-staging.org/stories_datause/
  2. https://hp-bison.gbif-staging.org/stories_events/
  3. https://hp-bison.gbif-staging.org/stories_news/

but that's a bit clunky. Essentially, I'm interested in a single page that provides a filtered view of the most recent, relevant news, events and data use stories from GBIF.org. No rush to get this done! It will be a nice feature but isn't hindering any work.

MortenHofft commented 4 months ago

That is a bug - I will look. I'm guessing that the random ID function isn't doing a good job. So the same container ID is used for all, and hence only one is updated

UPDATE: That is the issue. I'll try to specify in the theme that plugins should be inherited as well. If that isn't supported I will provide the option to provide explicit IDs

MortenHofft commented 4 months ago

turns out that Jekyll themes cannot inherit plugins. So I've changed it to use a less ideal random based on timestamps. That doesn't require a plugin and will work out of the box. And then there is now also the option to provide explicit IDs for the story that will be used if present. That should solve it.

sformel-usgs commented 4 months ago

Works beautifully, thank you! If anyone finds this and is looking for the end result, you can start here: https://github.com/gbif/hp-bison/blob/master/stories.md