72 | | When navitation item instances get processed, they receive a set of status flags which then are available for the renderer: |
73 | | |
74 | | ||='''Flag'''=||='''Meaning'''=||='''Comments'''=|| |
75 | | ||item.enabled||The item shall be rendered as enabled (accessible)||renderers would usually skip items with enabled=False, but could also render them greyed-out or otherwise visible but inaccessible; this flag will be altered by the return value of the check-hooks, and can be overridden by the check_enabled method of the class|| |
76 | | ||item.selected||The target URL of the item or any of its sub-items matches the current request||this can be used for menu highlighting; if more than one subtree can be matched, only items in the first matching subtree will be marked selected|| |
77 | | ||item.authorized||The user is permitted to access the target URL of this item||renderers would usually skip items the user is not permitted to access, but could also render the item greyed-out or otherwise visible but inaccessible|| |
78 | | ||item.visible||Custom flag to show/hide items||will always be True unless explicitly changed by a check-hook method|| |
79 | | |
80 | | S3Navigation items are run through a cascade of status checks: |
| 72 | S3Navigation items are run through a cascade of status checks before they get handed over to the layout method: |
| 83 | During the status check cascade, each navigation item receives a set of status flags which then are available for the renderer: |
| 84 | |
| 85 | ||='''Flag'''=||='''Meaning'''=||='''Comments'''=|| |
| 86 | ||item.enabled||The item shall be rendered as enabled (accessible)||renderers would usually skip items with enabled=False, but could also render them greyed-out or otherwise visible but inaccessible; this flag will be altered by the return value of the check-hooks, and can be overridden by the check_enabled method of the class|| |
| 87 | ||item.selected||The target URL of the item or any of its sub-items matches the current request||this can be used for menu highlighting; if more than one subtree can be matched, only items in the first matching subtree will be marked selected|| |
| 88 | ||item.authorized||The user is permitted to access the target URL of this item||renderers would usually skip items the user is not permitted to access, but could also render the item greyed-out or otherwise visible but inaccessible|| |
| 89 | ||item.visible||Custom flag to show/hide items||will always be True unless explicitly changed by a check-hook method|| |
| 90 | |
| 91 | It is up to the layout method whether and how each combination of flags influences the rendering of the item. |