Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've a requirement to show some custom links in OOTB "community tools" webpart (which will be shown only to community owners and moderators).

enter image description here

I've to remove few links and add some custom links to that web part, How can I do that?

share|improve this question
2  
Is hiding and showing with javascript good enough? Then a content editor webpart could be your best friend –  Robert Lindgren Nov 25 '13 at 12:39
    
how can I show it only for Community Owners and moderators? –  Sekhar2815 Nov 25 '13 at 13:43
1  
Well, since they are the only ones seeing this tools from the beginning, it would merely be a matter of looking that it exists before rendering anything? –  Robert Lindgren Nov 25 '13 at 13:46

2 Answers 2

The community tools web part, is part of the site template and not intendet to be edited. These links have been selected by the development team of the community feature to make management simpler.

Editing the web part isn't supported. One option to overcome the problem is to delete the Community Tools Web Part and customise a Content Editor web part making it look like a Community Tools Web Part. Links to add can be found from the CT Web Part.

More on Community...

Community sites include four wiki pages (Home, Categories, Members, and About), which are stored in the wiki page library. These pages include various web parts that may or may not be visible, depending on user privileges. For example, the Community Tools web part is displayed only to community owners and moderators and enables management of the community and its content. Just as you can customize a team site or wiki page library, you can customize these communities pages by adding additional text, images, and other web parts. For example, a community on a given topic or domain should have a look and feel that promotes that topic. This can be accomplished by applying a unique theme and background image, and by using a custom site icon. And, of course, you can also create additional pages for your community along with other typical SharePoint content, such as lists and libraries.

share|improve this answer

You have two options:

Audience Targeting

If you only want the web part to be visible to users in the community's owners and moderators groups (as you mentioned in your comment beneath your post), you can enter these group names into the "Audiences" property in the web part properties tool pane.

Pros: This approach is dead simple, and the web part won't be loaded at all for any users not in the specified groups (which is much faster and more secure than hiding via CSS or JavaScript).

Cons: This is a "show / hide" scenario and so doesn't allow you to customize the links on the web part. In addition, I'd check to make sure that the web part isn't needed on the page by the other community web parts (as is the case with SharePoint blogs where the "Blog Tools" web part registers JavaScript functions which are used by the other web parts on the page to build hyperlinks etc. -- even when the "Blog Tools" web part is hidden). And lastly, this relies on the users being in the specified groups -- not whether or not they have the "full control" or "moderate" permission granted to them, either directly, or via a different group.

JavaScript

You can use JavaScript / jQuery to dynamically add or remove links, for example:

    // Create a copy of the "Manage discussions" link, change its ID, text and target, then insert it back into the DOM as the second item.
    $("DIV.ms-comm-adminLinks > UL.ms-comm-adminLinksList LI.ms-comm-adminLinksListItem:first-child").after(function ()
    {
        var $manageOtherStuffHyperLink = $(this).clone();

        $manageOtherStuffHyperLink.children("A").each(function ()
        {
            $(this).text("Manage other stuff");
            $(this).attr(
            {
                id: "admlnk100",
                href: "http://www.google.com"
            });
        });

        return $manageOtherStuffHyperLink;
    });

    // Hide the "Create badges" link.
    $("DIV.ms-comm-adminLinks > UL.ms-comm-adminLinksList A[href^='/sites/communities/grad/Lists/Badges/AllItems.aspx']").parent().hide();

Pros: Your imagination is the only limiting factor here as far as customization goes.

Cons: Any customization's will only be applied after the page has rendered, so you may see a light "jump" as links are added / removed by your script. Plus, unless you explicitly remove the unwanted links from the DOM, they'll still be there for users to click if they know how to get at them using IE Developer Tools, or if they've disabled JavaScript.

share|improve this answer
    
Just a note: The Community Tools web part is already targeted toward community owners and moderators. Ref: Create a community –  Benny Skogberg Jul 10 at 9:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.