connectwidgets package external URL

I have a project where I have curated most of the content using the connect widgets package. Is there a way to create a connectwidget tile that links to an external URL? One piece of content is a Tableau dashboard and is not on Connect. I want to include it with the other curated content.

I keep wanting to take a look at this and time keeps prohibiting me - I really think there is a way to do this, and if there isn't, then there should be :see_no_evil:

Do you have an example of what you're doing or a reprex for easy reference? Maybe a jump start can get me into this! :rofl:

I'm not exactly sure what a reprex would look like in this scenario, but maybe this helps. Let's assume I have a widget card that points to content I've created on Connect (like below).

sample_content %>%
filter(str_detect(title, "SD9UP Dashboard")) %>%
rsc_card()

However, instead of a card linking to the Connect content "SD9UP Dashboard", I want a card that links to my organizations home page. Would I simply create a tibble like sample_content that contains my orgs URL?

Yeah, that's kinda what I was thinking. A reprex that creates a tibble and uses that to output a rsc_card(), etc. It is a bit tricky when the data is usually all getting pulled in from a Connect server :see_no_evil: You could also use https://beta.rstudioconnect.com, which is a public Connect instance :smile:

Something like:

tibble::tribble(
~ "some", ~"column",
"some", "data"
) %>%
  rsc_card()

I have a similar need to give custom urls. In my case I'd like to be able to use vanity urls (but the problem is the same). If I include this in a qmd the url created has the base url prepended to the specified url (in this case google):

tibble::tribble(
~ "guid", ~"title", ~"url",
  "2", "some", "www.google.ca"
) %>%
  rsc_card()

Is it currently possible to provide those custom urls?

This is a great question! I am pretty sure the following works, although I am not 100% sure I am tracking what exactly you want. By adding a protocol (i.e. http:// or https://), it makes clear to connectwidgets that you want to use an absolute URL and not a relative path.

tibble::tribble(
     ~ "guid", ~"title", ~"url",
     "2", "some", "https://www.google.ca"
) %>% connectwidgets::rsc_card()
1 Like

:man_facepalming: - yep that was it.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.