Hi,

It would be great to apply '*' character as wildcard.

To target any path like /activity/* for every activity page.

Cheers,

Comments

thecampious created an issue. See original summary.

webfaqtory’s picture

Status: Active » Needs review

Added wildcard to include paths.

webfaqtory’s picture

Status: Needs review » Reviewed & tested by the community
tea.time’s picture

Hi @webfaqtory,

Thanks for this module!

I think there's a partial bug in this implementation - it does not seem to work with path aliases, both individual aliases and patterns of aliases.

For example I tested the pattern "/locations/*" and I have nodes with aliases that begin with "/locations", but if I check `$current_path` on one of those nodes pages, it's the system path "/node/[nid]", so it fails to match.

I was hunting in the API for how block visibility rules do this check, and found this RequestPath condition plugin, which I'm guessing is it:
https://api.drupal.org/api/drupal/core%21modules%21system%21src%21Plugin...
See the `evaluate()` method, which retrieves the path alias as well, and checks both system path and alias with PathMatcher. I'm not sure how to use a condition plugin directly but you could borrow some of the logic from that method.

Hope this helps :)

  • webfaqtory committed af53d23 on 8.x-1.x
    Issue #3039682 by thecampious, webfaqtory: Allow wildcard on paths to...
webfaqtory’s picture

Status: Reviewed & tested by the community » Fixed

Added a check to the path for an alias

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.