nsahoo
August 1, 2018, 6:32pm
1
...Hello,
I am trying to build an application. My issue here is, I am not able to link a new Shiny page (which is not in the current application) to an header image. In short, when user clicks on the Header image, it should go to another Shiny Page where instructions to operate the application is given.
I would appreciate any help.
1 Like
There are a few options do this. However, it would be helpful to see a reprex.
Why reprex?
Getting unstuck is hard. Your first step here is usually to create a reprex, or reproducible example. The goal of a reprex is to package your code, and information about your problem so that others can run it and feel your pain. Then, hopefully, folks can more easily provide a solution.
What's in a Reproducible Example?
Parts of a reproducible example:
background information - Describe what you are trying to do. What have you already done?
complete set up - include any library() calls and data to reproduce your issue.
data for a reprex: Here's a discussion on setting up data for a reprex
make it run - include the minimal code required to reproduce your error on the data…
There was a discussion on this topic a few months back on using hyperlinks to navigate to other pages (see the last comment).
Hello all,
This is an update on the issue of linking other pages and tabs in a shiny app. We took the discussion offline and recently solved the problem. I've also created a demo app for those who are interested in creating internal links to specific pages or tabs (a link is provided at the end).
Background
To make this work you will need three things.
1. Manually assign a value for each tab
tabPanel("My Tab Name", value = "tab-value", ...)
2. JS function
The following function loops through all a elements and looks for a matching tab name (as defined above). When a match is found, the code will simulate a mouse click using click(); (this will advance the screen to the desired tab).
Pl…
To integrate this in images, wrapping tags$img
inside the tags$a
should do the trick.
tags$a("Some Title",
onclick="customHref('some-destination')",
tags$img(src = "path/to/image/image.png", alt= "my cool image")
)
1 Like
nsahoo
August 7, 2018, 7:16pm
3
Thank you for the help. HTML tag worked out.
jcblum
August 8, 2018, 2:23am
4
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:
If your question has been answered, don't forget to mark the solution!
How do I mark a solution?
Find the reply you want to mark as the solution and look for the row of small gray icons at the bottom of that reply. Click the one that looks like a box with a checkmark in it:
[image]
Hovering over the mark solution button shows the label, "Select if this reply solves the problem". If you don't see the mark solution button, try clicking the three dots button ( ••• ) to expand the full set of options.
When a solution is chosen, the icon turns green and the hover label changes to: "Unselect if this reply no longer solves the problem". Success!
[solution_reply_author]
…