URLs and tags in SharePoint 2013

Source: Internet
Author: User

types of URLs in SharePoint 2013

SharePoint 2013 parses the URL string to be based on the specified protocol (for example,http:) determines the format of the URL or determines the position of the forward slash (/) in the string. Depending on the specific member, you can use the following URL format:
  • The absolute URL specifies the full path and begins with the protocol. For example,http://domain_or_server/[sites/]web_site/lists/list_title/allitems.aspx.

  • The URL relative to the domain is based on the address of the domain (possibly the name of the server) and always begins with a forward slash. It specifies the full path from the top-most web site to the file name. For example,/[sites/]web_site/lists/list_title/allitems.aspx.

  • The URL relative to the site is based on the address of the site object (SPWEB). It does not start with a forward slash and specifies the full path from the Web site address to the file name. For example,lists/list_title/allitems.aspx.

  • The URL relative to the file or folder is based on the folder that contains the file. It does not contain any left slash, but only the name of the file specified. For example,allitems.aspx.

Notes

The concept of "URLs relative to site collections" does not exist; Passing such URLs can cause code to fail.

best practices for image URLs

When you create a pointer to an image file that is located in the%ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\15\template\layouts\1033\images Directory URL, you specify a path that uses the root site of the site collection, but that path does not contain subsites. For example, use/_layouts/images/myimage.gif instead of/mysubsite/_layouts/images/myimage.gif for image files. This is because the subsite URLs will be parsed in different ways, depending on where they are used. If you always use URLs that are relative to the root site, you can ignore these changes.

URL tags in SharePoint 2013

SharePoint 2013 allows you to use the tags listed in the following tables in a SharePoint-related application or farm solution. For more information, see URL strings and tags in SharePoint applications.

The tags in this section table can be used in URLs in various situations when you are developing SharePoint, such as in custom actions and in links to custom pages. In some contexts, some of these tags cannot be used. In the three most important locations, only restricted tag lists are available, which are the start page of the application, the custom actions on the host Web, and the SRC attribute of the application part. These locations will be labeled in a separate column, but these three do not constitute an exhaustive list of locations where the marks can be used.

The startpage column Specifies whether tokens can be used in the startpage element of the application manifest . The Custom Action column Specifies whether the token can be used in the URL of a custom action that hosts the Web. The Application Part column Specifies whether the token can be used in the SRC attribute of the application part.

Tags that can be used at the beginning of a URL

Mark

resolves to

StartPage

Custom Actions

Application Parts

Note

~controltemplates

The URL of the ControlTemplates virtual folder for the current Web site.

Whether

Whether

Whether

~layouts

The URL of the Layouts virtual folder for the current Web site.

Whether

Whether

Whether

~site

The URL of the current Web site.

Whether

Whether

Is

~sitecollection

The URL of the parent site collection for the current Web site.

Whether

Whether

Is

Unless otherwise noted, none of these tokens in the following table can be used in the path portion of the application Part SRC property value. The Application Part column indicates that you can use them in the query string portion of the value.

Tags that can be used in URLs

Mark

resolves to

StartPage

Custom Actions

Application Parts

Note

{ControlTemplates}

The URL of the ControlTemplates virtual folder for the current Web site.

Whether

Whether

Whether

{ItemId}

The ID (integer) of the item in the list or library.

Whether

Is

Whether

{Itemurl}

The URL of the project being processed.

Whether

Is

Whether

{Layouts}

The URL of the Layouts virtual folder for the current Web site.

Whether

Whether

Whether

{ListId}

The ID of the current list (a GUID).

Whether

Is

Whether

{Recurrenceid}

Periodic index of the recurring event.

Whether

Is

Whether

This tag is not supported in the context menu for list items.

{Site}

The URL of the current Web site.

Whether

Is

Is

{SiteCollection}

The URL of the parent site of the current Web site.

Whether

Is

Is

{SiteURL}

The URL of the current Web site.

Whether

Is

Whether

{Source}

HTTP request URL.

Whether

Is

Whether

URLs and tags in SharePoint 2013

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.