bildaps
November 28, 2022, 4:46pm
1
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:
Due to the above Const being null, then also the correlated Context variable is always null:
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?
aurelie
November 29, 2022, 12:55pm
2
This property is not used anymore, it’s a legacy feature. We should remove it from the explorer.
bildaps
November 29, 2022, 3:25pm
3
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
aurelie
November 29, 2022, 3:54pm
4
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
1 Like
bildaps
November 29, 2022, 4:22pm
5
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.