Change title/label of sidebar and main window in Golden template

Hi there,
first of all: thanks for your great work, I love panel!
My problem/question:
I want to use the golden template. It´s working quite nice.
Now I was wondering, if (and how) I could modify the label of the sidebar and the “tabs” in the main window:
image

My code looks something like that:

golden = pn.template.GoldenTemplate(title='MyTitle')
dummy_labels=["dummy1", "dummy2"]
Feature_Selection = Select(value="dummy1", options= dummy_labels)
golden.sidebar.append(Feature_Selection)
golden.main.append(pn.column("### Test0815")

Is it possible to define a custom label? If so, how can it be done? I could imagine for example something like this (sorry if it seems ridiculous, I´m quite a noob):

golden.sidebar.label = "My label"
# or
golden.sidebar.append(Feature_Selection, label = 'My label')
golden.main.append(pn.column("### Test0815"), label = 'my label')

Help would be very much appreciated. :slight_smile:

Hi @ingebert

Welcome to the community. If you set the name of your component you will use that as name of the tab

import panel as pn
golden = pn.template.GoldenTemplate(title='MyTitle')

dummy_labels=["dummy1", "dummy2"]
Feature_Selection = pn.widgets.Select(value="dummy1", options= dummy_labels)
golden.sidebar.append(Feature_Selection)

component1 = pn.Column("### Test0815", name="My Component 1")
component2 = pn.Column("### Test0815", name="My Component 2")
golden.main.append(component1)
golden.main.append(component2)
golden.servable()
2 Likes

As for the sidebar, its label seems to be hardcoded in an HTML template.

2 Likes

thank you both!

1 Like