I have a Shiny-based element in my learnr tutorial like so:
selectizeInput("ex_topic", "Topic", choices = list(
Select = c("Choose one" = ""),
Indexing = c(`Exercise 1` = "ex1", `Exercise 2` = "ex2"),
Subsetting = c(`Exercise 3` = "ex3", `Exercise 4` = "ex4")
)
)
When users click on an option, I want the learnr tutorial to automatically navigate to the page with that exercise (exercises are listed with the following headings in the r markdown)
## Exercise 1
## Exercise 2
In Shiny, a similar navigational idea is accomplished using:
observeEvent(input$ex_topic, {
if(input$ex_topic == "ex1") {
updateTabsetPanel(session, "navmaster", selected = "ex1")
}
}
where "navmaster" is the id for the entire shiny::navbarPage and pages are made in shiny::tabPanel