Home > Uncategorized > Tokens that can be used at the beginning of a URL in an app for SharePoint

Tokens that can be used at the beginning of a URL in an app for SharePoint

 

Token

Resolves to

StartPage

Custom Action

App Part

Remarks

~appWebUrl

The URL of the app web of an app for SharePoint.

Yes

Yes

Yes

This token 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

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: