def set_layout(self, layout, recursive=False, tag=None):
        """
            Alter the renderer for a tagged subset of items in the subtree.

            @param layout: the layout (renderer)
            @param recursive: set this layout recursively for the subtree
            @param tag: set this layout only for items with this tag
        """

        if layout is not None:
            if tag is None or tag in self.tags:
                self.renderer = layout
            if recursive:
                for c in self.components:
                    if tag is None or tag in c.tags:
                        c.set_layout(layout, recursive=recursive, tag=tag)
        return

    # -------------------------------------------------------------------------
    # Activation methods
    #
    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3/s3navigation.py/S3NavigationItem.set_layout/original