I want to add a button like "Share" or "Follow" next to Share or Follow button.
I want button to open an application page preferably on same master page without redirect.
As visible in this picture
This can be done with a delegate control targeting the PromotedActions
DelegateControl:
PromotedActions Delegate Control
The PromotedActions delegate control allows you to add your own content to the following area on a SharePoint site in the top-right section of the page
[..]
So what does the files look like for these parts of the project?
Elements.xml
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!-- DelegateControl reference to the PromotedActions Delegate Control --> <Control ControlSrc="/_controltemplates/15/Zimmergren.DelegateControls/PromotedAction.ascx" Id="PromotedActions" Sequence="1" /> </Elements>
PromotedActions.aspx (User Control)
<!-- Note: I've removed the actual Facebook-logic from this snippet for easier overview of the structure. --> <a title="Share on Facebook" class="ms-promotedActionButton" style="display: inline-block;" href="#"> <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/Zimmergren.DelegateControls/facebookshare.png"/> </span> <span class="ms-promotedActionButton-text">Post on Facebook</span> </a>
From Zimmergren
Or you could certainly accomplish it with a custom action injecting some script injecting a new element up in the Promoted Actions section