I'm not a Drupal or PHP developer by any stretch, so maybe someone more talented than me can suggest a better way to do this or produce a patch or something. In any event, what I was after was for the ability to match the paths specified to patterns in PathAuto, for example. So if I have a bunch of taxonomy terms configured to be /feed/xyz then entering a path of /feed|term-class would add term-class a class to all of these pages.

To accomplish this, I think I changed three things in the code.

1) changed $current_path to use getPathByAlias instead of getAliasByPath
2) left $enteredPath set to $url
3) changed the comparison to: if (substr($current_path,0,strlen($enteredPath)) == $enteredPath) {

I would not be surprised if there was a better way to do this, or a more php-y way to write 3) but it works great. Now it adds classes to all the paths that have been relabelled by PathAuto and that start with the same prefix as specified in the Page Specific Class UI.

Comments

GNUMatrix created an issue. See original summary.

gnumatrix’s picture

PS: This module is working great in D9 by the way. So helpful!

hardik_patel_12’s picture

Hi @GNUMatrix, really appreciate your good words for the module.

you can check working patch written in another similar issue.

hardik_patel_12’s picture

Status: Active » Closed (duplicate)