Skip to content

Add a new block display conditional that uses a JMESPath expression #340

@DiegoPino

Description

@DiegoPino

What?

Setting up Drupal Blocks precisely on ADO pages is tricky. The many ways an empty results view is not really empty and ends taking/using space are many. Also even if a View does not generate results, at a view level, deciding how to hide (with custom code, not possible out of the box) the exposed filters is basically impossible. If we depend only on the number of results we can end hiding a filter used, that because or input, ends in finding "nothing" and that needs to be exposed again so the user can undo its decision. Messy

Solution is to add another conditional plugin that uses a JMESPath evaluated against an ADO. Any non empty result evaluates to TRUE and shows the block, or hides if not.

Additionally I would love to add a Contextual Filter Validator for Views that uses a similar approach. Validates the passed ID to be of "ADO" type and also checks for a JMESPATH. that could allow us to avoid the View query at all. Both can complement each other/serve different purposes

Metadata

Metadata

Assignees

Labels

Drupal 10Upgrade economyDrupal 9Everyone's favorite version until Drupal 10 comesDrupal ViewsAsk and you should receiveSub ModulesWhen you need more .info.yml files to keep life organizedenhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions