73 | | S3Navigation items are run through a cascade of status checks before they get handed over to the layout method: |
| 73 | During the status check cascade, each navigation item receives a set of status flags which then are available to the layout method. It is up to the layout method whether and how each combination of flags influences the rendering of the item. |
| 74 | |
| 75 | ||='''Flag'''=||='''Meaning'''=||='''Comments'''=|| |
| 76 | ||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|| |
| 77 | ||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|| |
| 78 | ||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|| |
| 79 | ||item.visible||Custom flag to show/hide items||will always be True unless explicitly changed by a check-hook method|| |
| 80 | |
| 81 | === Statuc Check Cascade === |
| 82 | |
| 83 | All S3Navigation items are run through a cascade of status checks before they get handed over to the layout method. |
| 84 | |
| 85 | The default behavior of these methods is meant for menu items, which may though not fit for all types of navigation items. Where needed, the subclass should overwrite them accordingly. These methods won't take any parameter beyond {{{self}}} and are expected to return a boolean value. |
82 | | The default behavior of these methods is meant for menu items, which may though not fit for all types of navigation items. Where needed, the subclass should overwrite them accordingly. These methods won't take any parameter beyond {{{self}}} and are expected to return a boolean value. |
83 | | |
84 | | During the status check cascade, each navigation item receives a set of status flags which then are available for the renderer: |
85 | | |
86 | | ||='''Flag'''=||='''Meaning'''=||='''Comments'''=|| |
87 | | ||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|| |
88 | | ||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|| |
89 | | ||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|| |
90 | | ||item.visible||Custom flag to show/hide items||will always be True unless explicitly changed by a check-hook method|| |
91 | | |
92 | | It is up to the layout method whether and how each combination of flags influences the rendering of the item. |