February 21, 2012

Adjusting Note Board input field height

Task:

SharePoint 2010 Note Board input field height is a bit too much for my liking, so I would like to decrease the height slightly.
image

Solution:

Add Content Editor Web Part to the page, and set the following content in the HTML Source of the web part content. Adjust the pixel height to your liking.

<style>
.ms-socialCommentInputBox
{
min-height:20px!important;
}
</style>

Using CEWP will change the input field height only on the page on which CEWP is placed on. If you would like to change the height in all Note Boards across your site, you need to add the style into your Style Sheet that you are using across the whole site.

Result:

image
Technorati Tags:

February 17, 2012

Ribbon disappears when using jQuery.noConflict()

Issue:

When using jQuery.noConflict() method SharePoint Ribbon disappears. You will see the Ribbon top buttons, but not the actual Ribbon.

You see this:

image

When you should see this:

image

Solution:

Verify that you're only calling jQuery.noConflict() once. If you call it twice, you will see the before mentioned behavior. In my case I was calling it first in my .master page, and then in CEWP.

Technorati Tags: ,

February 14, 2012

Cannot set Note Board Web Part title in Page Layout

Challenge

When adding SocialCommentWebPart to your Page Layout with SharePoint Designer and trying to set the title of the web part, you cannot do it. SPD removes the Title attribute when you save the Page Layout file.

Here are the exact steps.
  1. Check out Page Layout file in SPD 
  2. Edit File in Advanced Mode 
  3. SocialCommentWebPart looks like this (removed all attributes that are not relevant):

    <SPSWC:SocialCommentWebPart runat="server" Title="" ...></SPSWC:SocialCommentWebPart>
  4. Add Title for the SocialCommentWebPart using the Tag Properties Task Pane in SPD 
  5. SocialCommentWebPart looks like this:

    <SPSWC:SocialCommentWebPart runat="server" Title="Comments &amp; Questions" ...><SPSWC:SocialCommentControl runat="server">
    </SPSWC:SocialCommentControl>
    </SPSWC:SocialCommentWebPart>
  6. Save Page Layout file in SPD by clicking Save 
  7. Check In the Page Layout file and select Publish a major version 
  8. Verify that the Page Layout file still contains SocialCommentWebPart tag and Title as in step 5. 
  9. Close Page Layout file in SPD 
  10. Edit the Page Layout File in Advanced Mode in SPD (do not check out the file) 
  11. SocialCommentWebPart tag has reverted to what it was in step 3

    <SPSWC:SocialCommentWebPart runat="server" Title="" ...></SPSWC:SocialCommentWebPart>
  12. Obviously using that Page Layout will result in SocialCommentWebPart having Untitled title 

Solution

According to Microsoft support, this is by-design and a feature of the product. To alter this functionality I created a simple jQuery script to change the title of the web part and placed the script in my .master page.

ExecuteOrDelayUntilScriptLoaded(function () { $(function() { // Set Note Board title $('td[title="Untitled"] span:first').html("Comments & Questions"); }); }, "sp.js");

There is also a PowerShell based workaround for this that might work in some cases here.

Technorati Tags: SharePoint,jQuery