@staticmethod
    def layout(item):

        # Manage flags: hide any disabled/unauthorized items
        if not item.authorized:
            item.enabled = False
            item.visible = False
        elif item.enabled is None or item.enabled:
            item.enabled = True
            item.visible = True

        if item.enabled and item.visible:
            if item.parent is None:
                # The main menu
                items = item.render_components()
                return UL(items, _id="nav")
            else:
                if item.components:
                    # A submenu
                    items = item.render_components()
                    _class = item.selected and "highlight" or ""
                    return LI(A(item.label,
                                _href=item.url(),
                                _id=item.attr._id,
                                _class=_class),
                              UL(items, _class="sub-menu"))
                else:
                    # A menu item
                    return LI(A(item.label,
                                _href=item.url(),
                                _id=item.attr._id))
        else:
            return None

# =============================================================================
Custom Layout Method
dataset/ETHPy150Open sahana/eden/modules/templates/ARC/layouts.py/S3MainMenuLayout.layout