How to add 2nd tab?


#1

now I have own tab in developing plugin.
I am going to add one more tab(BB_Motor). so I did:

__init__.py:
def get_template_configs(self):
        return [
            dict(type="settings", custom_bindings=True),
			dict(type='tab', custom_bindings=True, template='BB_Fan.jinja2'),
			dict(type='tab', custom_bindings=True, template='BB_Motor.jinja2')
            
        ]

    def get_assets(self):
        return dict(
            js=["js/BB_Fan.js"],
            css=["css/BB.css"]
        )  

BB_Motor.jinja2:

<h3>Test</h3>

result Image I captured a part of BB_Fan(first tab)

20180531110654



it appears BB_Fan tab not in BB_Motor tab. I could see BB_Motor tab in drop down but when I clicked there is no response.
what should I do? what am I missing?


#2

Not that I do this a lot, but the document here suggests that the jinja2 filename needs to include the word "tab" in it.

The file naming is important. It needs to be all lowercase and be in the format (where plugin ID is something like "bb_motor" perhaps):

templates/pluginid_tab.jinja2


#3

When I had just one tab, file name was same as your suggestion. but now I have two.
so I specified template name in function get_template_configs() I wrote in post.

also here document


#4

Maybe one of the plugin authors can help you more than I can.