@staticmethod
    def layout(item):

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

        if enabled and visible:
            if item.parent is not None:
                if item.enabled and item.authorized:
                    if item.components:
                        # Submenu
                        _class = ""
                        if item.parent.parent is None and item.selected:
                            _class = "highlight"
                        items = item.render_components()
                        if items:
                            items = LI(UL(items, _class="menu-extention"))

                        return [LI(A(item.label,
                                     _href=item.url(),
                                     _id=item.attr._id,
                                     _class=_class)), items]

                    else:
                        # Submenu item
                        if item.parent.parent is None:
                            _class = item.selected and "highlight" or ""
                        else:
                            _class = " "

                        return LI(A(item.label,
                                    _href=item.url(),
                                    _id=item.attr._id,
                                    _class=_class))
            else:
                # Main menu
                items = item.render_components()
                return UL(items, _id="main-sub-menu", _class="sub-menu")

        else:
            return None

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