Skip to content

Add data attribute to filter projects by state for featured-project widget

We've been requested to exclude archived projects on a page. We don't currently offer this feature with featured-projects.

I'm thinking the data attribute should look like:

Convenient values:

  • data-include-states="all" Includes 'archived', 'incubating' and 'regular'
  • data-include-states="active" Excludes 'archived', includes 'created', 'review', 'incubating', and 'regular'

Having these convenient values will prevent us the need to write every single possible state value in the data attribute. Will also better future-proof us if we ever add more active states. Less maintaining.

Specific state values

  • data-include-states="regular, incubating"

Having a list of specific values will allow us to create a list of only incubating projects, or of only regular projects. It gives us more control.

We need to keep in mind that this should also work with project proposals.

Edited by Olivier Goulet