Archive for SharePoint

When a Web Part Breaks Your Page

Have you ever been modifying the view of a web part when all of sudden the page crashes with no warning and no advice on how to fix it? I hate when that happens.
 
The solution, add ‘?contents=1’ to the end of the page url and it will open in Web Part Maintenance view. Delete the suspect web part, then try to reopen the page. It should open and work properly without the web part in question. You can then add the web part back to the page, and continue troubleshooting.

How To Delete Link to View All Site Content

This SharePoint tutorial is especially useful for sites on an extranet implementation, where external users don’t need to have the same access as your internal users. In this case, I need to delete the link to View All Site Content from the Quick Launch Bar so that links to lists are unavailable.

Note: This does not restrict their access to any of the lists or libraries here. They can still access these if they have the address. You will need to restrict permissions for each list and library individually.

Here are the steps I used to delete the link from the Quick Launch Bar:

  • Open the ‘default.master’ page in SP Designer located in the ‘Folder List’ on the left at: _catalogs –> masterpage –> default.master
  • Comment out the grey text below
  • Save the File
  • Don’t forget to check-in this file and then approve it (if needed)

Video Tutorial: How to Delete the View All Site Content Link in SharePoint Designer 2007:

Visit my SharePointCafe YouTube Channel today. All videos are in HD, expand video to full-screen mode for full HD experience.

MOSS 2007: Displaying Custom Fields in Content Query Web Parts

The Content Query Web Part (CQWP) allows you to display data from a list anywhere within a Site Collection, and it works very well to only display the data targeted for a SharePoint group when Target Audiences are enabled for rows of data in that list. However, by default the CQWP only displays the freaking ‘Title’ of the row of data, if you want to display all the other columns in the list you have to do these modifications described in the 7 steps below.  Tidbits/Fun Facts/Caveats:

  • The CQWP is only available with MOSS 2007, not with WSS 3.0!!
  • The CQWP cannot pull data from a Lookup field that allows multiple values. If you uncheck the ‘allow multiple values’ box then it works, but only 1 value of course.
  • Column Types: I copied this list:  

Display Column Type

Internal Column Type

Single line of text

Text

Multiple lines of text

Note

Choice

Choice

Number

Number

Currency

Currency

Date and Time

DateTime

Lookup

Lookup

Yes/No

Boolean

Person or Group

User

Hyperlink or Picture

URL

Calculated

Calculated

 
Holy crap, this was complicated. I was trying to learn how to do this through Heather Solomon’s blog and someone else’s blog from Microsoft and it wasn’t working right until I found this web page: http://msdn.microsoft.com/en-us/library/bb850574.aspx. The sticky point was how a column name is rendered when it has more than one word with a space between each. This is the proper way to code it for a two word situation (Department Code) in the ItemStyle.xsl file:

<td><xsl:value-of select=”@Department_x005F_x0020_Code” /></td>.  

This is the proper way to code it in the .webpart file:  
<property>Department_x0020_Code, Text;Unit_x0020_Code, Text;Department_x0020_Name, Text;Policy_x0020_Names_x0020_2009, Lookup;Policy_x0020_Names_x0020_2008, Lookup</property>
 
These are the seven overall steps (from the msdn web page above), the following sections show how you can customize the Content Query Web Part to display custom fields:
  1. Adding the Content Query Web Part to a Web page on an Office SharePoint Server 2007 site.
  2. Configuring the Content Query Web Part to work with the Project Status Reports document library and the Project Status Report content type.
  3. Exporting the Content Query Web Part to a .webpart file.
  4. Editing the exported .webpart file and setting the CommonViewFields custom property of the Content Query Web Part to request the Project Status Report content type custom fields.
  5. Editing the default XSLT transformation, which is used by the Content Query Web Part to display the Project Status Report content type custom fields.
  6. Importing the edited .webpart file to a Web page on an Office SharePoint Server 2007 site.
  7. Configuring the imported Web Part to use the new XSL style.

How to Edit DispForm.aspx

For a customer’s site I needed to create a custom display form (DispForm.aspx) so that I can change the action of the Close button on the Display Page to return user to home page instead of the list page, and I can hide the bread crumbs.
 
 
Don’t forget to open site in SP Designer, right-click on list in question, select ‘Properties’, select ‘Supporting Files’, and browse to new DispForm.aspx file.
 
For me, I renamed the original DispForm.aspx to DispForm_Default.apx made a copy of it named DispForm.aspx, but Sharepoint list still points to renamed file until you go select new file in properties area.

Edit Page option Greyed out or Missing or Disabled

While editing pages on your SharePoint sites you probably encountered a situation when the ‘Edit page’ option in the Site Actions menu is disabled (greyed-out)!

This is not an error. Edit page command will be disabled when another user has checked-out that particular page. To see which user has done so you will need to navigate to Pages library on your site.

If you have the right permissions and you need to edit the page, you can show the page editing toolbar and then click on Page -> Override Check Out. This will undo any changes the other users has made and the page will be checked out to you, but is useful if you really need to make a modification to the page.

However, If the Edit Page option is MISSING all together it is because MS decided to remove that option for that page for some reason! There is a hack, just append ?ToolPaneView=2 or ??ToolPaneView=2 to the end of the URL.

Setting My Site Blog to Allow Comments from All

By default, comments are not enabled with a new My Site blog. To allow users to make comments:
  • Under Admin Links in right menu, click ‘Manage Comments’…
  • Then click Settings > List Settings > Permissions for this list…
  • Then check the box next to Visitors group
  • Then in ‘Actions’ drop-down menu, click ‘Edit User Permissions’
  • Check ‘Contribute’ (uncheck ‘Read’ or leave it)
  • Now refresh browser window and the Comments box should appear.

Video Tutorial (1 minute): How to Enable Comments on My Site Blog:

Visit my SharePointCafe YouTube Channel today. All videos are in HD, expand video to full-screen mode for full HD experience.