Hi All,
As we have already known, In SharePoint 2013 there were 3 new Delegate Controls had introduced.
They are ,
- PromotedActions
- SuiteBarBrandingDelegate Conrtol
- SuiteLinks
In Our current post we will see how to add new link to a PromotedActions
Delegate Control.
PromotedActions Delegate Control will look as follows in
SharePoint Page.
Step 1:
Create One Empty SharePoint Project and Provide the Solution
Name and Choose the Solution Path and Click on OK.
Step 2:
Deploy the Solution as Farm Solution. Provide the Url in
next Screen and validate the Connection.
Step 3:
Add New UserControl to the Project from the Templates and
Provide the Name to it, In our case it is “MyCustomPromotedAction”
Now Our Solution Explorer looks as follows,
Step 4:
Now Open the “.ascx” of the User Control and paste the below
code.
<a title="Post On Twitter" class="ms-promotedActionButton" style="display: inline-block;" href="http://www.twitter.com">
<span class="s4-clust
ms-promotedActionButton-icon" style="width: 16px; height: 16px; overflow: hidden; display: inline-block; position: relative;">
<img style="top: 0px; position: absolute;" alt="Share" src="/_layouts/15/images/Practice/twitter.jpg"/>
</span>
<span class="ms-promotedActionButton-text">Post on Twitter</span>
</a>
Step 5:
Add Elements.xml file to the Solution, Provide the name and
click on Add.
Step 6:
Open the Elements.xml file and change the ContolSrc Path and map it to our new user control(MyCustomPromotedAction.ascx)
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Adding
DelegateControl reference to our custom PromotedActions Delegate Control -->
<Control ControlSrc="/_controltemplates/15/PromotedActions_Sample/MyCustomPromotedAction.ascx"
Id="PromotedActions"
Sequence="1" />
</Elements>
Step 7:
Now Deploy the Solution and Navigate to your site and check
.
The final Out come will be look as follows
You Can download the solution file from the below link.
Download Link:
https://sites.google.com/site/sharepointkitchenblog/PromotedActions_Sample.7zThanks.
Related Post
SharePoint
- Build Automation (CICD) of WebJob in SharePoint Online
- List view render using JSLink with Fabric UI
- Delete Quick Links using Powershell
- SharePoint Interview Questions and Answers..
- Issues:SharePoint Foundation 2013 Prerequisites installation(off line) on Windows Server2012 R2
- SharePoint Column Field Types
- Alternate to InfoPath Forms in SharePoint
- Get the Items inside the Folder in document Library in SharePoint 2013 using REST API
- SharePoint 2016 [Beta] Release Date
- SharePoint Modal Dailoge to Open Page
- What is Look up Column and how to use in SharePoint 2010,2013
- People Picker Check User Entry and Resolve
- How to Get User Data from AD (Active Directory) in SharePoint Using C#
- History of SHAREpoINt
- How to Create Application Page in SharePoint using Visual Studio 2010,2013
- Retrieve Site Features in SharePoint
- Weather Webpart by using Yahoo Service in Share Point
- Activate Telnet Client in Windows Server
- Navigate to another Page After Clicking on JavaScript Alert
- How to read List Item Version Collection Programmatically
- How to get Worker Process from Command Prompt
- How to Use DataTable.js in SharePoint webpart
- How to Deploy Master Page in Share Point
- Get Role Definition in SharePoint
DelegateControls
0 comments:
Post a Comment