Add current context data to a URL so that (as long as it is opened by Trello) the page will continue to be able to communicate with Trello via the Power-Up interface.
1 2// synchronously returns the "signed" URL var signedURL = t.signUrl("https://google.com", { anArg: 'hey' });
args
is an optional object where you can retrieve the values with t.arg
once you load this URL and initialize a t
.
In general, wherever possible, Trello does this for you automatically. So when you give a URL to t.popup for example, you don't have to sign it yourself first.
Currently there are two places where you will need to use t.signUrl
on your own:
attachment-thumbnail
when returning an initialize
iframe url:1 2window.TrelloPowerUp.initialize({ 'attachment-thumbnail': function (t, options) { return { url: options.url, title: parkName, image: { url: './images/nps.svg', logo: true // false if you are using a thumbnail of the content }, openText: 'Open in NPS', initialize: { type: 'iframe', url: t.signUrl(TrelloPowerUp.util.relativeUrl('authorize-link.html')) } }; } });
attachment-sections
when returning the content
iframe url:1 2window.TrelloPowerUp.initialize({ 'attachment-sections': function (t, opts) { return [{ id: 'abc123', claimed: opts.entries, icon: 'https://example.com/image.svg', title: 'My Section', content: { type: 'iframe', url: t.signUrl('./folder.html', { arg: 'why not' }) } }]; } });
This function currently assumes the URL provided to it does not already have a hash component.
Rate this page: