I am new to Dash and Python, so I am not sure if I am asking this question in the right way.
In some other programming languages, I could build a function, a stored proc, or another file of HTML code. This code then be loaded into a bigger file or web page.
For example, if I had a static section at the bottom of a web page, like the section at the bottom that always has copyright statement, a contact ling etc., I could put all of the html code into a separate function, a stored proc, or another file. Then on every web page, I could include this, and when the web page was executed, the code in my separate “container” would be placed into the web page and executed as if I had typed it out manually.
A simple example would be that if this is my code:
html.Div([
html.H1(‘Sample Title’),
html.P(‘Sample Text’)
])
I would like to do something like this
variable = html.Div([
html.H1(‘Sample Title’),
html.P(‘Sample Text’)
])
Then use the variable to insert the code in the appropriate spot on multiple pages.
Is there a way to do something similar in Dash Plotly?
I have looked at a def statement, and putting the code into a function. I am not sure how to "execute’ this function, if that is the way to do this.
Any help would be appreciated.