Add Links to Promoted Actions (de)


Add Links to Promoted Actions de Title
, ,

Promoted Action Links (z.B. Share,Follow,SYNC,EDIT) werden unterhalb der im Standardfall blauen Delta Suitebar (SkyDrive,Sites,NewsFeed) angezeigt.

Um einen Link hinzuzufügen muss das Promoted Actions Delegate Control überschrieben werden und die Lösung in der Farm bereitgestellt werden.

Mir ist kein “Out of the box” Weg bekannt um Links hinzuzufügen, daher machen wir das eben so:

 

1. In Visual Studio erstelle ein neues leeres SharePoint 2013 Projekt (1) und vergib den Namen: PromotedActions_Sample (2).

Add Links to Promoted Actions (de)_1

 

2. Veröffentliche es als Farmlösung

Add Links to Promoted Actions (de)_2

 

3. Füge eine neues Element hinzu.

a. Rechtsklick auf das Projekt (1)

b. Hinzufügen (2)

c. Neues Element (3)

Add Links to Promoted Actions (de)_3

 

4. Füge ein neues Benutzersteuerelement (1) mit dem Namen “MyCustomPromotedAction” (2) hinzu.

Add Links to Promoted Actions (de)_4

 

Der Projektmappen-Explorer sollte nun so aussehen:

Add Links to Promoted Actions (de)_5

 

5. Ersetzte die ‘PromotedLinksDelegateCtrl.ascx’ Datei durch diesen Code:

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %> 
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyCustomPromotedAction.ascx.cs" Inherits="PromotedActions_Sample.ControlTemplates.PromotedActions_Sample.MyCustomPromotedAction" %>
<a title="Display your checked out Items" class="ms-promotedActionButton" style="display: inline-block;" href="http://sp13/teams">
<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="http://sp13/PublishingImages/CheckedOut.png"/>
</span>
<span class="ms-promotedActionButton-text">Display your checked out Items</span>
</a>

 

Add Links to Promoted Actions (de)_6

 

6. Füge nun ein Leeres Element (1) hinzu und vergib den Namen “PromotedActions” (2).

Add Links to Promoted Actions (de)_7

 

Ersetze den Inhalt der Elements.xml durch:

<?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>

7. Nun stelle das Projekt bereit.

8. Wenn alles geklappt hat sollte es so aussehen:

Add Links to Promoted Actions (de)_8

 

Hinweis: Falls du das Projekt, Benutzersteuerelement oder das leere Element anders benannt hast prüfe genau die ascx und die xml, da dort die Verweise eingetragen sind.

Ich habe zwei Bilder erstellt die du gerne verwenden kannst, sodass du ein passendes Icon neben dem Link hast. Das Bild sollte eine maximale Höhe von 16px haben.

Wie immer, “don’t be afraIT” und hol dir die Icons.

Leave a Reply

Your email address will not be published. Required fields are marked *