Custom Links/Buttons in SharePoint Online 2010 Ribbon - sharepoint

I'm new to SharePoint and am looking to add some custom links or buttons to the ribbon (only want these to show on the ribbon when the advanced ribbon menu controls are not showing, if that makes sense). I'm on SharePoint Online (2010 edition, but will convert to 2013 shortly).
Here's a screenshot of where I'm looking to add links or buttons.
I think the code section in the v4.master that controls this area is this section but I'm having problems getting my links to show up in the correct area.
<div class="s4-trc-container-menu">
<div>
<wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false">
</wssuc:Welcome>
<wssuc:MUISelector ID="IdMuiSelector" runat="server"/>
</div>
</div>
Any suggestions? Much appreciated!

Assuming that you are using v4.master as your master page (default), there is a control with an ID of "RibbonTabRowRight" that surrounds the code snippet you have posted.
Any links and buttons that you want to add should go within this control, and before the Welcome Menu (the snippet you have posted). Whether you use a simple anchor tag or a more complex control depends on your requirements.
Example:
<SharePoint:SPRibbonPeripheralContent
runat="server"
Location="TabRowRight"
ID="RibbonTabRowRight"
CssClass="s4-trc-container s4-notdlg">
<SharePoint:DelegateControl runat="server" ID="GlobalDelegate0" ControlId="GlobalSiteLink0" />
<div class="s4-trc-container-menu">
<a href="EXAMPLE.ASPX" />MY EXAMPLE</a>
<div>
<wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false">
</wssuc:Welcome>
<wssuc:MUISelector ID="IdMuiSelector" runat="server"/>
</div>
</div>
<SharePoint:DelegateControl ControlId="GlobalSiteLink2" ID="GlobalDelegate2" Scope="Farm" runat="server" />
<span>
<span class="s4-devdashboard">
<Sharepoint:DeveloperDashboardLauncher
ID="DeveloperDashboardLauncher"
NavigateUrl="javascript:ToggleDeveloperDashboard()"
runat="server"
ImageUrl="/_layouts/images/fgimg.png"
Text="<%$Resources:wss,multipages_launchdevdashalt_text%>"
OffsetX=0
OffsetY=222
Height=16
Width=16 />
</span>
</span>
</SharePoint:SPRibbonPeripheralContent>

Related

Kentico event calendar widget source code

I can't find the source code for the html used for the calendar table. I have the webpart, but not the html for the table. I need to strip the inline CSS and attributes.
Following is the markup for the event calendar (obviously this is what you see):
<%# Control Language="C#" AutoEventWireup="true"
Inherits="CMSWebParts_EventManager_EventCalendar" CodeFile="~/CMSWebParts/EventManager/EventCalendar.ascx.cs" %>
<div class="Calendar">
<cms:CMSCalendar ID="calItems" runat="server" EnableViewState="false" />
</div>
<div class="EventDetail">
<cms:CMSRepeater ID="repEvent" runat="server" Visible="false" StopProcessing="true" EnableViewState="false" />
</div>
So what you see on the live page is created by CMSCalendar control, which leaves in CMS.Controls library, which means you can't modify it unless you have full source code of Kentico.
I'd try to change the appearance of this control with CSS, if CSS doesn't work there is javascript/jQuery.
Have you looked into creating a skin? You can change the css classes used if needed.
Might help some

Modifying the position of title text content placeholder in SharePoint 2010

I am a beginner in SharePoint and I have a SP 2010 teamsite where in my aim (for now) is to modify the web header and title.
Under the style tag "s4-titletext" which contains the title of the page followed by navigation link (I assume that is breadcrumb navigation), I would like to shift the whole block below the title icon instead of beside it...
Is there an OOTB to do this? or would I have to go through the designer?
I tried the Designer way and was able to shift the block below the title icon, however it shows me only the Site title and not the breadcrumb link.....
<td class="s4-titletext" >
<h1 name="onetidProjectPropertyTitle">
<asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server">
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/" id="onetidProjectPropertyTitle"><SharePoint:ProjectProperty Property="Title" runat="server" /></SharePoint:SPLinkButton>
</asp:ContentPlaceHolder>
</h1>
<span id="onetidPageTitleSeparator" class="s4-nothome s4-bcsep s4-titlesep">
<SharePoint:ClusteredDirectionalSeparatorArrow runat="server"/> </span>
<h2>
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
</h2>
<div class="s4-pagedescription" tabindex="0" >
<asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat="server"/>
</div>
</td>
Where am I possibly going wrong.... :(

SharePoint 2010 - RichImageField not displaying in display mode

I am currently doing some research into SharePoint Page Layouts and building pages based on those layouts.
I currently have a page layout containing several RichImageFields and RichHtmlFields, but it seems that the first RichImageField is not displaying (doesn't even render out anything).
As far as I can see, he's the same as the others:
<div id="headerImage">
<PublishingWebControls:RichImageField id="HeaderImage" FieldName="HeaderImage1" runat="server"/>
</div>
<div id="middleContent">
<div id="left">
<div id="about">
<fieldset>
<legend>About</legend>
<PublishingWebControls:RichHtmlField ID="About" FieldName="AboutMedicInfo1" runat="server"/>
</fieldset>
</div>
<div id="items">
<h1>
<SharePointWebControls:FieldValue FieldName="ItemsTitle1" runat="server"/></h1>
<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
<SharePointWebControls:TextField runat="server" FieldName="ItemsTitle1" />
</PublishingWebControls:EditModePanel>
<div id="Item1">
<fieldset>
<legend>
<SharePointWebControls:FieldValue FieldName="Item11" runat="server"/></legend>
<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
<SharePointWebControls:TextField runat="server" FieldName="Item11" />
</PublishingWebControls:EditModePanel>
<PublishingWebControls:RichHtmlField ID="Item1" FieldName="Item1Content1" runat="server"/>
</fieldset>
</div>
<div id="Item2">
<fieldset>
<legend>
<SharePointWebControls:FieldValue FieldName="Item21" runat="server"/></legend>
<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
<SharePointWebControls:TextField runat="server" FieldName="Item21" />
</PublishingWebControls:EditModePanel>
<PublishingWebControls:RichHtmlField ID="Item2" FieldName="Item2Content1" runat="server"/>
</fieldset>
</div>
</div>
</div>
<div id="center">
<div>
<PublishingWebControls:RichImageField id="HighLight1" FieldName="HighLight11" runat="server"/></div>
<div>
<PublishingWebControls:RichImageField id="HighLight2" FieldName="HighLight22" runat="server"/></div>
<div>
<PublishingWebControls:RichImageField id="HighLight3" FieldName="HighLight32" runat="server"/></div>
</div>
<div id="right">
<div id="report">
<PublishingWebControls:RichHtmlField ID="Report" FieldName="Report" runat="server"/>
</div>
<div id="webparts">
<WebPartPages:WebPartZone runat="server" Title="Rechtsonder" ID="BottomRightControl"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone></div>
</div>
</div>
</div>
The funny thing is that I'm perfectly able to see the image when I'm in editing mode and when I'm viewing the Page Library items (after I added the specified field to the view).
Does anyone have any experience with this? Feel free to ask further questions if I might be unclear.
Okay, I should have checked before posting my initial question. It turned out that my problem was because I was using the Page content type, instead of the Article Page or Welcome Page content types. The Page CT doesn't have the field that the image was looking for.
What I find really interesting is that it still let me select the image AND it stored the value somewhere... even though there was no official field for it. I suspect that the field in the library is there, since you would need it for your other content types.
Anyway, hoping that someone else may find this useful.
Make sure that you don't miss the two properties RichText="TRUE" and RichTextMode="FullHtml" of the image field definition to be like:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field
ID="{4ea31e74-f59d-4ddf-863c-607a01735f65}"
Name="pls_H2_2_Image"
DisplayName="Titel 2 Bild"
Type="Image"
Required="FALSE"
RichText="TRUE"
RichTextMode="FullHtml"
Group="Custom">
</Field>
</Elements>
I faced this issue before and this solution did it properly.

Update Wiki pages to display SharePoint Fields and not break Site Definition

I have a requirement to display SharePoint fields as a footer on only certain pages, so this rules out a master page change, and I haven't had any success with plain-old HTML.
What I'm trying to display is the following code:
<SharePoint:DeveloperDashboard runat="server"/>
<div class="s4-notdlg" style="clear:both; background-color:orange; padding:10px">
<SharePoint:CreatedModifiedInfo ControlMode="Display" runat="server">
<CustomTemplate>
<br>Page Contact: <SharePoint:FormField FieldName="Page Contact" runat="server" ControlMode="Display" DisableInputFieldLabel="True" />
<br>Last modified on <SharePoint:FieldValue FieldName="Modified" runat="server" ControlMode="Display" DisableInputFieldLabel="True" />
by <SharePoint:FormField FieldName="Author" runat="server" ControlMode="Display" DisableInputFieldLabel="True" />
<br>Comments: <SharePoint:FormField FieldName="Check In Comment" runat="server" ControlMode="Display" DisableInputFieldLabel="True" />
</CustomTemplate>
</SharePoint:CreatedModifiedInfo>
</div>
When editing the page in Advanced Mode, no matter where I place the code, I break site definition. Is there a good place to insert this code in the page? Or does the Site Definition need to be changed.
Breaking the Site Definition may not be what you are thinking. It is just saying to you that the page is not one of the 'defaults' anymore, as a way to identify what have been customized on the site.
Every edit you make on those pages are like that, so it is OK to get that message. You may also "reset to site definition" when you want to, but this is not usually very stable on my experience.

SharePoint 2010 WebPart Personalize Layout

I have a homepage on an Intranet. It has at 15+ webparts (news, weather, etc.) I want to allow the users to customize the page by moving the webparts around or deleting them. At present I don't let them see the ribbon at the top so they don't have access to the "Edit page" button. I have pulled it out from the Ribbon
<a unselectable="on" href="javascript:;" onclick="return false;" class="ms-cui-ctl-large" aria-describedby="Ribbon.WebPartPage.Edit.Edit.Menu.Actions.Edit_ToolTip" mscui:controltype="Button" role="button" style="height: auto;" id="Ribbon.WebPartPage.Edit.Edit-SelectedItem">
<span unselectable="on" class="ms-cui-ctl-largeIconContainer">
<span unselectable="on" class=" ms-cui-img-32by32 ms-cui-img-cont-float">
<img unselectable="on" alt="" src="/_layouts/1033/images/formatmap32x32.png" style="top: -160px; left: -96px;">
</span>
</span>
<span unselectable="on" class="ms-cui-ctl-largelabel" style="height: auto;">Edit<span unselectable="on">
</span>Page</span>
</a>
Unfortunately it is not working. Any thoughts?
I will be doing the same with the "Stop Editing" button as well.
According to this post: http://artykul8.com/2011/03/useful-sharepoint-shortcuts/
the trick is to use the MSOLayout_ToggleLayoutMode(); javascript function.
According to a comment in that same page, in SP2010, that javascript function is only available when you already have a web part in the page. The behavior I observed differs from this one, given that, to me, this function only worked when the page was in edit mode already (and it worked even when the page had no web part added).
I was able to find the javascript file where that function is defined, which is the ie55up.js. You can load it in your masterpage by doing:
<SharePoint:ScriptLink language="javascript" name="ie55up.js" OnDemand="false" runat="server" />
For information about how to build a web control that uses that javascript function, see here: http://www.codeproject.com/KB/sharepoint/SwitchWPMode.aspx
Hope this helps
I finally found the answer to this question. It was very simple after the JS call was determined. I believe this should be for a webpart only page.
To put the page in edit mode for Personalization via a Javascript call:
ChangeLayoutMode(true); // how simple is that??
To stop the editing of the page via a Javascript call:
MSOLayout_ToggleLayoutMode(); // same as given in the other post
The "Stop" edit mode I believe is the same for all pages no matter if it's a personalized page, all webparts page, etc.

Resources