I just added a bootstrap nav bar and adjusted my code to implement it and the navbar appeared but the callback is not working… it just goes to the set home page each time and also every time i click on the bottom/link it adds a /apps/apps into the url? this is the code for my index.py…
///
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_bootstrap_components as dbc
import pandas as pd
import plotly.express as px
from app import app
from app import server
from apps import vgames, global_sales, nlp, home, live, alpaca, nlpdial
app = dash.Dash(name)
app.layout = html.Div([
dcc.Location(id=‘url’, refresh=False),
dbc.NavbarSimple(
children=[
dbc.NavLink(“Home”, href="/", active=“exact”),
dbc.NavLink(“HOME 1”, href=“apps/home”, active=“exact”),
dbc.NavLink(“VGAMES”, href=“apps/vgames”, active=“exact”),
dbc.NavLink(“GLOBAL SALES”,
href=“apps/apps/apps/global_sales”, active=“exact”),
dbc.NavLink(“LIVE”, href=“apps/live”, active=“exact”),
dbc.NavLink(“NLP”, href=“apps/nlp”, active=“exact”),
dbc.NavLink(“NLPDIAL”, href=“apps/nlpdial”, active=“exact”),
dbc.NavLink(“Alpaca”, href=“apps/alpaca”, active=“exact”),
],
brand=“BB Swap Research & Analytics”,
color=“primary”,
dark=True,
),
dbc.Container(id=“page-content”, className=“pt-4”),
]
)
@ app.callback(Output(component_id=‘page-content’, component_property=‘children’),
[Input(component_id=‘url’, component_property=‘pathname’)])
def display_page(pathname):
if pathname == ‘/apps/vgames’:
return vgames.layout
if pathname == ‘/apps/global_sales’:
return global_sales.layout
if pathname == ‘/apps/nlp’:
return nlp.layout
if pathname == ‘/apps/home’:
return home.layout
if pathname == ‘/apps/live’:
return live.layout
if pathname == ‘/apps/alpaca’:
return alpaca.layout
if pathname == ‘/apps/nlpdial’:
return nlpdial.layout
else:
return home.layout
if name == ‘main’:
app.run_server(debug=False)
//
this is the screen shot of the url/address bar after i have clicked on the bottom numerous times…
its like there is a counter in the url somehow, each time i click on vgames, nlp or any of the buttons only the home page appears and in the url it adds another apps/apps/apps/. etc??? Any help would be appreciated! THX