connectwidgets icon indicating copy to clipboard operation
connectwidgets copied to clipboard

Prefer Vanity URL on links

Open edgararuiz opened this issue 3 years ago • 3 comments

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.

edgararuiz avatar Aug 12 '21 19:08 edgararuiz

Following. Have a customer feedback request on this issue.

kmasiello avatar Sep 17 '21 23:09 kmasiello

Agreed, this would be a big improvement

iainmwallace avatar Apr 15 '22 00:04 iainmwallace

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
}

trangdata avatar May 23 '23 21:05 trangdata