SharePoint 2013 supports the tokens listed in the following tables for use in apps for SharePoint.
The StartPage column specifies whether the token can be used in the StartPage element of an app manifest.
The Custom Action column specifies whether the token can be used in the URL of a custom action on a host web.
The App Part column specifies whether the token can be used in the Src property of the app part.
Tokens that can be used at the beginning of a URL in an app for SharePoint.
|Token||Resolves to||Start Page||Custom Action||App Part||Remarks|
|~appWebUrl||The URL of the app web of an app for SharePoint.||Yes||Yes||Yes||Should be used only outside an app web. Within the app web itself, use ~site for the URL of the app web.|
|~controlTemplates||The URL of the ControlTemplates virtual folder for the current website.||No||No||No|
|~hostUrl||The URL of the host web.||No||No||Yes|
|~hostLogoUrl||The URL of the logo of the host web.||No||No||No|
|~layouts||The URL of the Layouts virtual folder for the current website.||No||No||No|
|~remoteAppUrl||The URL of a remote web application in an app for SharePoint.||Yes||Yes, in the host web, but No in the app web.||Yes||If you are not using Visual Studio and Microsoft Office Developer Tools to develop your app for SharePoint, you can use ~remoteAppUrl only in the StartPage URL of autohosted apps. However, when you are using Visual Studio and the tools, you can use this token for any provider-hosted app and it is resolved when Visual Studio packages the app. In this usage, it is really more of a Visual Studio token than a SharePoint token. It can be used outside the app manifest for both provider-hosted and autohosted apps.|
|~site||The URL of the current website.||No||No||Yes|
|~sitecollection||The URL of the parent site collection of the current website.||No||No||Yes|
Except where indicated otherwise, none of the tokens in the next table can be used in the path portion of the Src property value of the app part. The App Part column refers to their use in the query string portion of the value.