Url variables in dash multipage app

I have a multipage app working, but I would like to be able to pass the app a variable via the url.

before i implemented multipage https://whatever.com/dashapp/2022-12-15 would render the data from 12/15/2022.

now I want the page called “bars” to have that behavior.

so https://whatever.com/dashapp/bars/2022-12-15 should render the same data

but it doesn’t work! I’m getting 404s.

my default layout looks like this:

dash_app.layout = html.Div([
        Location(id='url', refresh=False),
        page_container
    ])

and the callback looks like this:

@dash_app.callback(
    Output("holder-holder", 'children'),
    Input("url", "pathname")
    )
    def reload_graphs(pathname):
        print(pathname)
        date_ = pathname.split("/")[-1]
        bg_ = bar_grapher_generator(date_)
        return bg_.bar_charts

Hello @af412,

Assuming you are using pages, you can use variables in the page itself: