Context problem of connecting customaction to the aspx page in layouts

Source: Internet
Author: User

If you customize customaction

<Customaction id = "customactions. itemssending. Announcements"
Location = "Microsoft. Sharepoint. standardmenu"
Groupid = "actionsmenu"
Title = "push to homepage"
Sequence = "100"
Imageurl = "/_ layouts/images/contentpush/itemssend.gif"
Description = "push the topic entries to the specified topic on the homepage. "
Registrationtype = "list"
Registrationid = "104">
<Urlaction url = "/_ layouts/contentpush/sendingpage. aspx">
</Customaction>

In the background code of your ASPX page, spcontext. Current. Web will be the context of rootweb.

Let's get started. Modify urlaction to the following. The logic is to parse the relative URL of the current web, and then spell out the connection address. For example, the address of your current website is http: // mossserver: 2007/docs, the address you spelled out should be/docs/_ layouts/contentpush/sendingpage. aspx

<Urlaction url = "javascript: function process () {var siteurl = '{siteurl}'; var pageurl = '/_ layouts/contentpush/sendingpage. aspx '; var po = siteurl. indexof ('/', 7); var relativeurl = siteurl. substring (PO, siteurl. length); var currentwebpageurl = relativeurl + pageurl + '? Siteurl = {siteurl} & amp; listid = {listid} '; window. Location. href = currentwebpageurl;}; process (); "/>

 

You can check the parameters that come with SharePoint on msdn. I will give them here.

 

Windows SharePoint Services supports the following urls:

~ Site-relative link of the website (spweb.

~ Sitecollection-the relative link of the site set (spsite.

In addition, you can use the following tags in the URL:

{Itemid}-indicates the integer ID of the project in the list.

{Itemurl}-the URL of the project being processed. Only applicable to documents in the library. [Does not work in Beta 2]

{Listid}-indicates the guid of the list.

{Siteurl}-the URL of the website (spweb ).

{Recurrenceid}-duplicate index. This tag cannot be used in the context menu of the list item.

 

 

Summary

1. Some parameters are supported by Windows SharePoint Services.

2. the URL can use scripts.

3. customaction can also specify the list, content type, and permissions.

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.