How do I substitute URL template fields?

The URL can include field names that Shotgun will substitute with values based on the page's entity. For example, on a shot detail page, you could supply the following URL which would reference the shot code and the linked sequence code:

http://your_internal_server/sequence/{sg_sequence.Sequence.code}/shot/{code}

The URL will dynamically update for any shot a user is viewing.

There are three fields that pertain to the current user logged into Shotgun that can also be used in the URL string:

  • {current_user.login}
  • {current_user.id}
  • {current_user.fullname}

To find the field codes, go to the "fields" page under the Settings menu and look at the "Field Code" column.

Pro Tip:  Try adding a text field to the entity with the URL you want to load on each entity page. For example, you can create a field called "Wiki" on the Asset entity that you fill in the URL for every asset. Then on your page, you can insert that field code into the URL field in brackets: {sg_wiki}. That will simply insert the URL from the text field and load in the page.
Follow

0 Comments

Please sign in to leave a comment.