connectwidgets
connectwidgets copied to clipboard
Prefer Vanity URL on links
Prefer to link to the Vanity URL of a given content if one exists when the end-user click on an RSC card or grid. That way, the end-user will be able to bookmark that URL, instead of one containing a GUID.
Following. Have a customer feedback request on this issue.
Agreed, this would be a big improvement
A workaround to get the vanity URL but then all the thumbnails go away... 😭
get_vanity_url <- function(client, guid) {
van <- tryCatch(
{
suppressMessages(
jsonlite::fromJSON(
client$GET(sprintf("/v1/content/%s/vanity", guid))
)
)
},
error = function(e) {
return(NULL)
}
)
if (is.null(van)) {
return("")
}
van$path
}