Description Usage Arguments Value Examples
View source: R/overwrite_core_tabs.R
If you want to load your custom content on any of the default tabs in a SPS project, you can overwrite the tab with your own UI and server function. First, use this function to create a template for the tab you want to replace and then fill your own content.
1 2 3 4 5 6 | spsCoreTabReplace(
replace_tab,
app_path = getwd(),
open_file = TRUE,
overwrite = FALSE
)
|
replace_tab |
one of "welcome", "module_main", "vs_main", "canvas", "about", for the welcome tab, module home tab, custom tab home tab, Canvas tab, about tab respectively. |
app_path |
string, where is SPS project root path |
open_file |
bool, open the newly created template if you are in Rstudio? |
overwrite |
bool, if the template exists, overwrite it with a new, empty one? |
a template file
1 2 3 4 5 6 7 8 9 10 | if(interactive()){
spsInit(project_name = "default_overwrite_demo",
change_wd = FALSE, open_files = FALSE)
## try to run it for the first look
# shiny::runApp("default_overwrite_demo")
spsCoreTabReplace("welcome", app_path = "default_overwrite_demo")
## edit the file and save it.
## run again and watch the difference on the welcome tab.
shiny::runApp("default_overwrite_demo")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.