SharePoint 2020

The Vision for a Future of Clarity

Add a “Create Alert” dialog link in a Content Editor Web Part

This is the code I have used in a Content Editor Web Part to display a “Create Alert” link.  It’s probably not the preferred method but it’s what I used to get it working in my environment.

Update: I utilized some of the instructions below from Mike Smith’s Tech Training Notes: http://techtrainingnotes.blogspot.com.au/2011/10/sharepoint-create-alert-from-anywhere.html

The link pops up in a dialog window as if the user selects the same option from the Ribbon.

This is useful if you are hiding the Ribbon from users with Read access or if you are displaying multiple Lists within a Web Part Page.

1: First, from the Alert Me option in the Ribbon and select Manage my Alerts.  Click Add Alert to bring up the lists and libraries of the site.

2:  Select the list you would like to use for the “Create Alert” link and click Next.

3: When the next page loads, “Listname – New Alert”, copy the URL and paste it into a text editor.  The URL should look like this:

http://sharepointserver/_layouts/SubNew.aspx?List={A0E53466-4C68-4DFC-AD6A-42DF8FAD1541}&Source=%2F_layouts%2FMySubs.aspx 

4: Add the following to the end of the URL to display the dialog without the master page:  &isdlg=1

5: From here copy this URL X 2 into the following bit of code:

<A id=idHomePageNewItem onclick=’javascript:NewItem2(event, “http://sharepointserver/_layouts/SubNew.aspx?List={A0E53466-4C68-4DFC-AD6A-42DF8FAD1541}&Source=%2F_layouts%2FMySubs.aspx&isdlg=1“);javascript:return false;’href=”http://sharepointserver/_layouts/SubNew.aspx?List={A0E53466-4C68-4DFC-AD6A-42DF8FAD1541}&Source=%2F_layouts%2FMySubs.aspx&isdlg=1” target=_self><img alt=”Receive alerts in email” src=”../../_layouts/images/lg_ICMSG.gif” border=”0″ width=”20″ height=”20″> Subscribe to Announcement Alerts</a>
6: Copy the code into a text file, upload it to your SharePoint “scripts” folder, copy the link and paste into a Content Editor Web Part.

You should now see this:

When Clicked, a Dialog Popup will display the Create Alert window:

Thanks for reading, any questions, please comment below.

Advertisements

July 10, 2012 - Posted by | SharePoint 2010 | , , ,

2 Comments »

  1. Your code as presented here has curly quotes – they need to be straight quotes to work.

    Comment by David Robarts | September 2, 2016 | Reply

    • Thanks David, WordPress stripped out the code at the time of this post and I had no idea how to post code on the page at the time.

      Comment by Brett | September 2, 2016 | Reply


Post a Comment

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: