Because you cannot invoke methods with arguments/parameters in HTL expressions.
Your best bet in this case is to create a helper Use-Object (either a POJO or a Sling Model) that allows passing the path when it's initialised and has a getter for the page corresponding to the path.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more