How do I set page Category for utilization in Context formulas?

I’d like to display or hide page elements based on page category.

There is a null Const in the Pages menu in the formulas workspace:

image

Due to the above Const being null, then also the correlated Context variable is always null:

image

I’d like to populate the page category Const so that it populates the Context variable so that I can utilize the latter in binding logic.

I can’t find the page category in the page properties panel:

Question: How can I populate the page category for app pages?

This property is not used anymore, it’s a legacy feature. We should remove it from the explorer.

Hi @aurelie, thanks for your reply. I’m not entirely sure why page categorization was phased-out, I can imagine that there could be some technical challenges at that level of logic abstraction, yet, applying page-level logic in binded-formulas would be a powerful gem :gem:

What you can do is having an object variable defining for each pageName (or id) the category you want, and then you will be able to access it quickly :slight_smile:

1 Like

That’s a wonderful and efficient/performant solution, one page can be in one category at a time, there can be as many categories as needed.

For the readers, this is how @aurelie 's description looks like on screen:

1. Creating an object variable:


Note: duplicate keys in the object default value will be merged and assigned to the latter value (it’s an array with unique keys).

2. Accessing the object and/or its key-paired values in formula editor:


Note: depending on the formula logic you have you can pull the whole object/array into the formula or any number of its key-value pairs.