Ribbon Customization in SharePoint 2013

Hello Friends,
i want to customize ribbon . i written bellow custom action
<CustomAction Id="WebPartContextualTabs" Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ContextualTabs._children">
          <ContextualGroup Id="WebPartContextualTabGroup" ContextualGroupId="WebPartContextualTab" Sequence="150" Title="WebPart Contextual Tab Tools" Color="Green"
Command="WebPartContextualTab.OnEnableContextualTab">
            <Tab Id="Ribbon.PropertyChangerTab"
                 Title="Tools"
                 Sequence="501">
             <Scaling Id="Ribbon.PropertyChangerTab.Scaling">
                <MaxSize Id="Ribbon.PropertyChangerTab.MaxSize"
                   GroupId="Ribbon.PropertyChangerTab.PropertyGroup"
                   Size="LargeLarge" />
             </Scaling>
              <Groups Id="Ribbon.PropertyChangerTab.Groups">
                <Group Id="Ribbon.PropertyChangerTab.PropertyGroup" Title="PropertyGroup" Sequence="25"
                 Template="Ribbon.Templates.Flexible2" >
                  <Controls Id="Ribbon.PropertyChangerTab.PropertyGroup.Controls">
                    <Button Id="Ribbon.PropertyChangerTab.PropertyGroup.GeneralDialogButton"
                            LabelText="Write to Web Part"
                            Command="WebPartContextualTabs.OnPostback"
                            TemplateAlias="o1"
                            Sequence="15"
                            Image16by16="/_layouts/Images/TestProject/16x16Placeholder.png"
                            Image32by32="/_layouts/Images/TestProject/32x32Placeholder.png" />
                  </Controls>
                </Group>
              </Groups>
            </Tab>
          </ContextualGroup>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="WebPartContextualTab.OnEnableContextualTab" CommandAction=""></CommandUIHandler>
        <CommandUIHandler Command="WebPartContextualTab.OnPostback" CommandAction="javascript:_doPostBack('RibbonizedWebPartPostback','');"/>
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
ok i have create a contextual group, A tab and a button which does postback, the ribbon shows in Webpart whose cs code is shown bellow.
        public string POSTBACK_EVENT = "RibbonizedWebPartPostback";
        protected override void CreateChildControls()
            this.Controls.Add(new LiteralControl("<em>Ribbonised Webpart test</em>"));
            RaisePostBack();
        private void RaisePostBack()
            if (this.Page.Request["_EVENTTARGET"] == POSTBACK_EVENT)
                this.Controls.Add(new LiteralControl("<em>This is from postback</em>"));
        protected override void OnPreRender(EventArgs e)
            base.OnPreRender(e);
            LoadAndActivateContextualTab();
        private void LoadAndActivateContextualTab()
            SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
            if (ribbon != null)
                ScriptLink.RegisterScriptAfterUI(this.Page, "SP.Ribbon.Js", false, true);
                ribbon.MakeContextualGroupInitiallyVisible("Ribbon.WebPartContextualTabGroup", string.Empty);
                ribbon.MakeTabAvailable("Ribbon.PropertyChangerTab");
i am facing two probulems.
1. when webpartpage is loaded tab is not visible. how ever when i click on some other ribbon tabs such as page it is showing
2. when i click on the button then _EVENTTARGET is null.
Please guide me or at least suggest some link from where i can build strong conceps???
Thanks
Mukesh

Hello all
in spite of _EVENTTARGET is null if i pass _EVENTARGUMENT then i can retrive that argument .
can not understand whats happening.
Please Help.
Mukesh

Similar Messages

  • Adding Attchement button inside create new discssion in SharePoint 2013 Discussion Board not from the Ribbon

    all that i want to customize create a new discussion layout by adding new attach new document but not by using Ribbon

    Hi,
    For your issue, you can customize the layout for the discussion board new form with content editor web part.
    For more information, you can refer to the blog:
    http://www.markrackley.net/2013/08/29/easy-custom-layouts-for-default-sharepoint-forms/
    http://www.shillier.com/archive/2013/03/26/uploading-files-in-sharepoint-2013-using-csom-and-rest.aspx
    Actually in my opinion, the new file upload behavior in SharePoint 2013 is great. As we can click in the body and upload files via the ribbon INSERT tab.The
    new 2013 discussion board allow attachments to be stored in any document libraries besides the default Site Asset library.
    Reference:
    http://sharepointconnoisseur.blogspot.in/2013/07/tips-to-use-sharepoint-2013-discussion.html
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Eric Tao
    TechNet Community Support

  • How to customize top navigation css in SharePoint 2013?

    Hi All,
    How to customize top navigation css in SharePoint 2013?(Want to add colors for each link in the navigation)
    My current page is like-
    Expected-

    Hi Sam,
    Please check the following article about how to style the top navigation with custom css.
    How to: Brand snippets by using CSS in SharePoint 2013
    Thanks
    Daniel Yang
    TechNet Community Support

  • Unable to Customize SharePoint 2013 Discussion Board

    Hi,
    We are trying to customize SharePoint 2013 Discussion Board app and are unable to modify existing Flat, Subject, and Threaded views or create new views.  Following are the error messages we are getting:
    *** Error message when creating new views based on view types Subject, Flat, or Threaded:
    TypeError: Unable to get value of the property '0': object is null or undefined
    Note that when creating the view no options are available (only option to name and make default are available).  The view created after display of this error message does not have any Columns, Sort, Filter or
    other properties defined.  Manually defining these properties does not make the view function as desired (Flat view is not flat).
    *** Error message when editing existing default views Subject, Flat, or Threaded:
    Cannot complete this action.
    Please try again.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Note that this is nothing to troubleshoot or error number provided.  The URL shows /_vti_bin/owssvr.dll?CS=65001.  Also, the edit screen does not show any view property to change.
    Note that both ability to edit existing views and create new views work in SharePoint 2010.  This issue is with SharePoint 2013.  Please guide to resolve this.  View in other apps can be edited. 
    This issue is only with the Discussion Board app. 
    -Thanks, Maqsood.

    You will not be able to modify the default view in SharePoint 2013 i.e. Subject/Flat or threaded. However you can create a new view based on your requirement and use it.
    When you try to create new view, the fields will not be available for you to select during creation of view, instead create a view with proper name, once the view is created, go back for modifying the new view and you will have the fields available for selection.
    Note: Make sure you have mandatory CU installed on the farm.
    Raghavendra Shanbhag | Blog: www.SharePointColumn.com
    Please click "Propose As Answer " if a post solves your problem or "Vote As Helpful" if a post has been useful to you.
    Disclaimer: This posting is provided "AS IS" with no warranties.

  • Controls in ITEM and LIST tabs of Ribbon disabled always in Punishing SharePoint 2013 site if i add list to home page as List View Webpart

    Hi,
    Below is the scenario,
    If i created any custom list and navigating to the list (AllItems.aspx) and on selecting the item, i can see controls in ITEM and LIST tabs of Ribbon are enabled in SharePoint 2013 publishing site.
    If i add the same list in the home page (add web part --> select list view webpart) in the publishing site, on selecting of item, all controls in ITEM and LIST tabs of Ribbon are disabled always.
    Please help me to fix this issue ASAP.
    Regards,
    Krishna

    Hi,
    Thanks for your reply.
    Ribbon controls (only ITEM and LIST tab) still in disabled mode even if i selected the item in the list view webpart.
    Also, i have noticed the below things,
    when i create a published site (default page : default.aspx) and add the list view webpart in the default page, the controls are in disabled mode on selecting item in list view webpart.
    when i create a team site (default page : home.aspx) and add the list view webpart in the default page, the controls are in enable mode on selecting item in list view webpart.
    Please help me on this.
    Regards,
    Krishna

  • Ribbon disabled on Publishing Pages in SharePoint 2013

    When using a blank web part page in a Pages Library (Publishing Feature actived), the ribbon is disabled for a document web part on the page.
    After adding the document web part and saving the page, I click in the document web part to activate the ribbon. Clicking on the Files tab in the ribbon display the document library ribbon but it is disabled. Clicking on the library tab also displays a disabled
    ribbon.
    We have been able to reproduce this in multiple instances of SharePoint 2013 Enterprise including on a client site.
    This works in SP2010!
    In a site pages library this also works in SP2013...
    Is this a bug in SharePoint 2013 or is this working as designed in SharePoint 2013
    Thanks in advance!

    I tried to replicate the issue by creating the page with blank web part page, but i can see the Ribbon is available.
    MCTS,MCPD Sharepoint 2010. My Blog-
    http://www.sharepoint-journey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful

  • SharePoint 2013 - Missing Publishing Page Ribbon/Tab on custom page layout - Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,.... VS CodeBehind="BlogDemo.aspx.cs" Inherits="DemoProject.Branding.BlogDemo"

    I created page layouts using Visual Studio 2013 and SharePoint 2013. I added both ASP.NET web controls (e.g. asp:Label, asp:HyperLink) and SharePoint web controls (e.g. SharePointWebControls:UrlField) in a page layout.
    However, when I deployed the solution, I cannot edit all the ASP.NET & SharePoint web controls (column fields from custom content type used for the page layout) except the web part zones.
    Then I found out about inherits property:
    1) if I use the code for the page layout as shown below:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BlogDemo.aspx.cs"
    Inherits="DemoProject.Branding.BlogDemo" MasterPageFile="/_catalogs/masterpage/DemoProject/DemoMasterPage.master"
    %>
    Result: There is no publishing ribbon/tab. E.g. Edit, Publish..... although both ASP.NET & SharePoint web controls can be displayed on the page layout.
    Screenshot:
    2) if I use the code instead as shown below:
    <%@ Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"
    meta:progid="SharePoint.WebPartPage.Document" %>
    Result: Publishing ribbon/tab is available, but ASP.NET web controls won't appear. Only SharePoint web controls appear on the page layout.
    Screenshot:
    I wonder how I can combine both codes to ensure that the page layout can have publishing ribbon/tab and displays both ASP.NET & SharePoint web controls.

    Found a way to solve the issue
    I follow the solution:
    http://pinnacleofindiana.com/blog/developers/2012/03/28/creating-a-sharepoint-2010-page-layout-with-code-behind/
    http://blogs.msdn.com/b/kaevans/archive/2011/04/02/code-behind-page-layouts-with-visual-studio-2010.aspx

  • Not able to Enable the Custom Ribbon button On Pages in Sharepoint 2013

    Hi Team,
    Not able to Enable the Custom Ribbon button On Pages in SharePoint 2013. we have used the button edit properties section of the Pages.
    Same is working for Lists but not for Pages.
    Thanks,
    Shrikant

    Thanks for your reply.
    Right now my server is not working to get the code. will share you in some time.
    I am just thinking if page get checked out and my control is also present in the Edit properties section then do I need to specify something explicitly to enable the button. The same is working for Lists.

  • Hide Ribbon - Sharepoint 2013

     I have added the following to hide the ribbon for users that dont have full control.
    It works to hide the ribbon for users that don't have full control, but on the users it removes it from it removes half of the viewing space on the page.
    When I remove the SPSecurityTrimmedControl it goes back to normal. 
    Could someone assist with troubleshooting this. Any help is appreciated. 
    <div id="ms-designer-ribbon" >
    <!--MS:<SharePoint:SPSecurityTrimmedControl runat="server" PermissionsString="ManageWeb" EmitDiv="true">-->
    <!--SID:02 {Ribbon}-->
    <!--PS: Start of READ-ONLY PREVIEW (do not modify) --><div class="DefaultContentBlock" style="background:rgb(0, 114, 198); color:white; width:100%; padding:8px; height:64px; overflow:hidden;">In true previews of your site, the SharePoint ribbon will be here.</div><!--PE: End of READ-ONLY PREVIEW -->
    <!--ME:</SharePoint:SPSecurityTrimmedControl>-->
    </div>

    Hi Try this code in here
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
    <script type="text/javascript">
    $(function(){
    ExecuteOrDelayUntilScriptLoaded(setRibbonbyUserPermissons, "sp.js");
    function setRibbonbyUserPermissons()
    var context = new SP.ClientContext.get_current();
    web = context.get_web();
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.load(web,'EffectiveBasePermissions');
    context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
    function onSuccessMethod(sender, args)
    if (!web.get_effectiveBasePermissions().has(SP.PermissionKind.manageWeb))
    $("#s4-ribbonrow").hide();
    function onFailureMethod(sender, args)
    console.log('Fail: ' + args.get_message() + '\n'+ args.get_stackTrace());
    </script>
    https://rvieiraweb.wordpress.com/2013/04/08/hideshow-ribbon-by-user-permissons-sharepoint-2010/
    http://sharepoint.stackexchange.com/questions/69133/jquery-sp-js-objects-to-test-if-current-sharepoint-user-has-full-control-owner
    Kind Regards,
    John Naguib
    Technical Consultant/Architect
    MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
    Please remember to mark your question as answered if this solves your problem

  • Does anyone know how to customize a Site page on SharePoint 2013? Also does anyone have any recommendations on course to take to learn this?

    Hello All,
    I am new to using the 2013 SharePoint and want to customize the site pages that was set up by someone else. The problem is when i click on the site pages I only see the option to upload and new. So the pages that have been uploaded in the past i clicked
    on them and when they come up it just shows the title of the site page with edit links button on the top.  
    So basically you are not able to do anything. Does anyone know if this is a permissions issue and if it is how do i give myself admin rights
    Nexusxox

    Hi,
    From your description, you want to know how to edit a page in SharePoint 2013.
    Go to the page->click Settings->Edit page,refer to the following screenshot:
    If a user want to edit a page, he at least have edit permissions.
    If you have any problems, please don't hesitate to let me know.
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Customize search result types in SharePoint 2013

    Hi
    I want to create the new Search Result types based on existing "List SharePoint Item" result type. I know how to do it manually . But i want it to automate it. can i do it using powershell script? is there anything available or somebody tried anything
    in this direction?
    So my requirement is bascially create the Result type with custom display template. Please suggest how to do using powershell script or sharepoint object model.
    Thanks

    Hi,
    According to your description, my understanding is that you want to create search result source programmatically in SharePoint 2013.
    Here are some links about creating search result source programmatically for you to take a look:
    http://sadomovalex.blogspot.com/2014/04/create-custom-search-result-source.html
    http://blog.tippoint.net/create-result-source-with-powershell-sharepoint-2013/
    http://mksharepointblogs.wordpress.com/2014/01/16/create-result-source-programmatically-in-sharepoint-2013/
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Customize Sharepoint 2013 Blog Post forms and layout

    I have a blog site that will be home to customer call reports saved as posts to the blog. The blog works, but how do I get all the custom columns to show on the blog home page that shows all of the posts. Currently, only the Posted Date, Notes, and Title
    field display.

    Hi Jim ,
    According to your description, my understanding is that  you want to display custom columns in your home page posts web part.
    Please go to the home page -> Edit Page -> Edit the Posts Web Part ->in the Posts Web Part Settings Page , click  Edit the current view -> check the column you want to display and click OK.
    The fields  are  now available to be rendered as part of the current view.
    Then we need to create the custom JavaScript file that will render the new fields for  the post body. You can refer to the blog:
    HOW TO: Add a custom field to blog posts in SharePoint 2013
    Hope this helps!
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to Implement custom share functionality in SharePoint 2013 document Lib programmatically?

    Hi,
    I have created custom action for Share functionality in document library.
    On Share action i'm showing Model pop up with Share form with addition functionality.
    I am developing custom share functionality because there is some addition functionality related to this.
    How to Implement custom share functionality in SharePoint 2013  document Lib pro-grammatically?
    Regards,
    - Siddhehswar

    Hi Siddhehswar:
    I would suggest that you use the
    Ribbon. Because this is a flexible way for SharePoint. In my project experience, I always suggest my customers to use it. In the feature, if my customers have customization about permission then i can accomplish this as soon
    as possible. Simple put, I utilize this perfect mechanism to resolve our complex project requirement. Maybe we customize Upload/ Edit/ Modify/ Barcode/ Send mail etc... For example:
    We customize <Edit> Ribbon. As shown below.
    When user click <Edit Item>, the system will
    render customized pop up window.
    Will

  • How can i get a full url of video uploaded in asset library on sharepoint 2013

    Hi All,
    I have videos in SharePoint 2013 Asset Library, now i want display that videos in my SharePoint webpage as a webpart.
    Now, how can i get a full url of video uploaded in asset library?
    Thanks in Advance!

    The Asset library does a pretty good job of hiding the full URL. An "asset" item is actually a folder. The folder contains the video and support files like preview thumbnails.
    So, if you upload a video named butterfly.wmv to http://yourSite/sites/demo/Assets the path to the video would be http://yourSite/sites/demo/Assets/butterfly/butterfly.wmv. If the user changed the name while uploading the file to "Pretty bugs"
    the URL would then be http://yourSite/sites/demo/Assets/Pretty%20Bugs/butterfly.wmv.
    Probably the best way to explore these hidden folders and discover the "real" URL is to use SharePoint Designer 2013.
    Launch SharePoint Designer and open your site.
    In the Navigation area click "All Files". (If you don't see All Files then your administrators may have partially locked down SPD.)
    In the list of files and folders click the Assets library.
    Find and click your video (you will see the "Name" as entered in the file's properties, not the file name.)
    Find the video file, right-click it and click Properties.
    Copy the Location.
    If you just want to display the video in the page:
    Edit the page
    Click INSERT
    Click Web Part
    From the Media and Content category select Media Web Part and click Add.
    Edit the web part (click the web part's dropdown)
    From the MEDIA ribbon click Change Media
    Click From SharePoint and navigate to your assets library and pick a video
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • SharePoint 2013 issues in IE11

    We have recently moved in VDI environment (Windows 8.1, Office 2013, IE11) and we are now experiencing some compatibility issues with SharePoint 2013 applications. Some of the issues observed are,
    1. Clicking on the ellipsis besides the document or document set does not open the list of options
    2. nothing happens when clicked on document set. The workaround for this is right clicking  on teh document set and opening in a new tab or window. But we would like to open the document set through the left click.
    3. When Files/Library option is clicked on, the ribbon disappears.
    The IE version installed is IE 11.0.9600.17351.
    I have read some forums and tried to use the recommended steps like using compatibility mode in IE11,  debugging, but it did not work.
    Do you know if Microsoft have released a patch to address these issues?
    Are there any workarounds or fixes for these issues?

    Two things to check...
    Are you running the 32 bit version of IE 11 (generally do not use the 64 bit version)
    Which patch / service pack level is your SharePoint Server at? (SP 1 of SharePoint 2013 (not IE) fixed a number of the IE 11 issues.)
    http://support.microsoft.com/kb/2880552
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

Maybe you are looking for

  • Can I use this printer with my macintosh SE?

    I have a macintosh SE form 1986, i need a printer and i have found this one on a hardware shop near by at a very fair price: Apple Color StyleWriter 2500. Can I use it with my mac? Will be a problem the software with the 800K diskettes? In case this

  • Watch Tv with apple 20 inch LCD monitor

    I have a 20 inch apple LCD monitor, I dont want to use it for my computer, instead I would want to use it to watch tv. How shd I do it or what shd I buy?

  • KE30 report: Graphic not displaying all charcateristic values

    Hi Experts, I created a report in KE30, and in classic view, when I select 1 characteristic and 1 value field to view in a 3D graphic, I don't see all the characteristic values that were displayed in the report. I have 73 characteristics but only 30

  • Error when installing Oracle Identity Manager

    Hello, I'm having a problem when trying to install Oracle Identity Manager. I am trying it now for consecutive two days and it is always the same problem. I read this thread: Problem installing Oracle Identity Manager Server (but still have no clue w

  • Instr function for table column

    hi, lets consider the basic soctt.emp table. i need to check for the first occurence of 'a' in the Ename column in emp table. select instr(ename,'a') from empabove function does not seem to work Please advise. Regards