You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Related to dfe-analytical-services/dfeshiny#51 we want to add an example of linking to different tabs / page views from within the text on a page. We could also use the same page to show an example of the external_link() function too.
Describe the solution you'd like
An example on one of the tabs where we link to another tab for navigation from some text. We can create a new tab for this and include examples of headings, maybe a notification banner, some warning text, and the external_link() function if we want. I'm happy for this to be flexible / chosen by who implements it, though the key thing is the example of linking from text to another tab / page in the dashboard.
Describe alternatives you've considered
We considered adding an internal_link() function, like what we have for external links, but given the amount of different ways you could do this, and there's not too many people who have examples in their apps that would use this right now, the time to creating a robust function for dfeshiny didn't seem like it was worth the effort (though we can revise if proven wrong!).
Additional context
Example bslib code to do if within a module
# Internal link UI function
InternalLinkUI <- function(id) {
ns <- shiny::NS(id) # Namespace the module
actionLink(ns("internal_link"), "LA Level page")
}
# Internal link server function
InternalLinkServer <- function(id,
tabset_id,
tab_value,
parent_session) {
moduleServer(id, function(input, output, session) {
observeEvent(input$internal_link, {
# Switch to the specified tab
bslib::nav_select(
id = tabset_id,
selected = tab_value,
session = parent_session
)
})
})
}
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Related to dfe-analytical-services/dfeshiny#51 we want to add an example of linking to different tabs / page views from within the text on a page. We could also use the same page to show an example of the
external_link()
function too.Describe the solution you'd like
An example on one of the tabs where we link to another tab for navigation from some text. We can create a new tab for this and include examples of headings, maybe a notification banner, some warning text, and the
external_link()
function if we want. I'm happy for this to be flexible / chosen by who implements it, though the key thing is the example of linking from text to another tab / page in the dashboard.Describe alternatives you've considered
We considered adding an
internal_link()
function, like what we have for external links, but given the amount of different ways you could do this, and there's not too many people who have examples in their apps that would use this right now, the time to creating a robust function for dfeshiny didn't seem like it was worth the effort (though we can revise if proven wrong!).Additional context
Example bslib code to do if within a module
The text was updated successfully, but these errors were encountered: