| 96 | Subclasses of S3NavigationItem must implement the layout method: |
| 97 | |
| 98 | {{{ |
| 99 | class MyMenuLayout(S3NavigationItem): |
| 100 | |
| 101 | @staticmethod |
| 102 | def layout(item): |
| 103 | # Layout goes here |
| 104 | }}} |
| 105 | |
| 106 | Usually, this should be a static method. It will be called with an instance of the same class, and is expected to return a web2py HTML helper instance (i.e. a subclass of DIV, which implements the xml method). |
| 107 | |
| 108 | S3NavigationItem provides an API for the layout method (=renderer) to introspect the item before rendering. |
| 109 | |
| 110 | ==== Item Attributes ==== |
| 111 | |
| 112 | ||='''Attribute'''=||='''Type'''=||='''Contents'''=||='''Comments'''=|| |
| 113 | ||'''controller'''||string||controller name of the item target URL||don't use directly, use get method instead|| |
| 114 | ||'''function'''||string||function name of the item target URL||don't use directly, use get method instead|| |
| 115 | ||'''application'''||string||application name of the item target URL||don't use directly, use get method instead|| |
| 116 | ||'''r'''||request object||the request this item got matched against||defaults to current.request|| |
| 117 | ||'''args'''||list of strings||the args for the item target URL|| || |
| 118 | ||'''vars'''||dict of strings||the query variables for the item target URL|| || |
| 119 | ||'''extension'''||string||the format extension for the item target URL|| || |
| 120 | ||'''tablename'''||string||the name of the target table of the item target URL|| || |
| 121 | ||'''attr'''||dict||the HTML attributes||as passed during item definition|| |
| 122 | ||'''opts'''||dict||the renderer options||as passed during item definition|| |
| 123 | |
| 124 | ==== Introspection Methods ==== |
| 125 | |
| 126 | ==== Rendering Methods ==== |