I want to create a visibility condition so that page template properties are only visible on pages that do not start with a specific path. The HttpContext returns the CMS path while editing a page so I tried to get the url for the page being edited using the IWebPageDataContextRetriever and IWebPageUrlRetriever. However the method to override, "Evaluate", does not have an async option.
I asked Kentico AI, and it said "If you require synchronous behavior, you would typically need to call the asynchronous method and block on it (e.g., using .GetAwaiter().GetResult()
), but this is generally discouraged in ASP.NET Core applications due to potential deadlocks and performance issues."
Is there another way to get the webpage URL within the VisibilityCondition Evaluate method?
Another way might be to set a property for the template from within the controller but I dont see a way to set template properties this way.
is there some other way I can get the property to hide or disable on a page starting with a specific url?
Environment
Xperience by Kentico version: [30.3.1]
.NET version: [8]
Execution environment: [SaaS|Private cloud (Azure/AWS/Virtual machine)]
Link to relevant Xperience by Kentico documentation