Nick Grattan's Blog

About Microsoft SharePoint, .NET, Natural Language Processing and Machine Learning

Archive for the ‘SharePoint Power User’ Category

Logging in as a different user

with 7 comments

When using default.master in SharePoint users have the “Sign in as Different User” menu option on the “Welcome” menu to login as a different user. This is useful when testing security etc.

This menu is often removed when customizing sites – clients we find often do not want these options displayed. So how can you add a link to allow this facility for testing?

The “Sign in as Different User” navigates to the /_layouts/AccessDenied.aspx page, which displays thus:

Accessdenied

You’ll notice the link “Sign in as a different user”. From the browser status bar you can find the target of this link:

Accessdenied2

So, it turns out to login as another user you simply need to navigate to:

/_layouts/AccessDenied.aspx?loginasanotheruser=true

The standard browser username/password dialog box will be displayed without the “Access Denied” page being displayed to the user.

 

 

 

Written by Nick Grattan

December 3, 2008 at 1:11 pm

Posted in SharePoint Power User

Tagged with ,

Changing Order / Hiding Columns in New / Edit Forms

with 31 comments

The default order of columns in New/Edit forms for lists and document libraries is typically the order they are added. In many cases you may want to change this order, or to remove columns from these forms.

Changing the column order is easy but the method depends on whether you have selected “Allow management of content types” for the list. See below if you have this option selected, otherwise you can:

  1. Open the list and select Settings + List Settings
  2. Select the “Column ordering” link under “Columns”.
  3. Use the “Change Field Order” form to change the order of columns.

Colorder1

You can only hide columns if “Allow management of content types” is selected! So, to hide, for example, the “Title” column you can:

  1. Open the list and select Settings + List Settings
  2. Select Advanced settings
  3. Click Yes for “Allow management of content types” and then click OK.
  4. From the list of content types, select the content type the column appears in, e.g. “Item”.
  5. From the list of columns for the selected content type, select the column (e.g. Title).
  6. Select Hidden and click OK.

Colorder2

Even if you have a single content type, selecting the “Allow management of content types” option does no harm, so this should work in all cases.

Note that when displaying the content type there is a “Column Order” link under the list of columns which can be used to change the order of columns.

In this example, “Title” is a required field, but you can still hide it. The form will allow the item to be created or updated even though a value has not been supplied.

Written by Nick Grattan

December 2, 2008 at 3:57 pm

Posted in SharePoint Power User

Tagged with ,

Stubborn Publishing Pages

with 3 comments

This knowledge article describes the limitation with folders in the “Page” publishing document library – they are ignored by the publishing features and all publishing pages are placed in the root. That’s OK, I can live with that.

In a recent project, I wanted to create a new document library (“News Articles”) that used publising to maintain a list of news stories used by the site. So, I create a new document library, enable content types and add the “Page” content type from the “Publishing Content Types” group. Standard stuff…

Next to testing; I create a new item based on the Page content type, select the page layout and create the new item. The list of documents in my news article document library is freshed … and it’s empty. I try again – and again – and the document library remains stubbornly empty. I check the current view (is there a filter?) and permissions (I’m the site collection administrator); no luck.

Sometime later, I list of the content of the standard “Pages” document library created by the publishing feature. Lo and behold – all my new document pages are there! Rather than creating the new pages in my “News Articles” document library it placed them in the “Pages” document library.

So, not only does publishing ignore folders, it also ignores the document library you try to place pages in! We live and learn.

 

Written by Nick Grattan

September 15, 2008 at 3:27 pm

Finding the Id (Guid) for a SharePoint List

with 46 comments

There are times when you need to find the Id (a Guid) of a list – for example, when setting the Task list to be used with SharePoint Designer Workflows (see my blog post here). Here’s a simple way of doing this:

  • Navigate to the SharePoint list using the browser.
  • Select the Settings + List Settings menu command.
  • Copy the Url from the browser address bar into Notepad. It will look something like:

http://moss2007/ProjectX/_layouts/listedit.aspx?List=%7B26534EF9%2DAB3A%2D46E0%2DAE56%2DEFF168BE562F%7D

  • Delete everying before and including “List=”.
  • Change “%7B” to “{”
  • Change all “%2D” to “-“
  • Chnage “%7D” to “}”

You are now left with the Id:

{26534EF9-AB3A-46E0-AE56-EFF168BE562F}

Update: See Ken’s Comment for a simpler solution (thanks!):

A (slightly) easier way if you have MOSS 2007 is to go to the List or Library settings as described above, then right-click on the “Audience targeting settings” or “Information management policy settings” links and choose Copy Shortcut.

You can then paste the URL and there’s no need to decode the GUID. For some reason these links aren’t URL encoded.

Update: These techniques work for SharePoint 2010 Standard/Enterprise editions as well. Using Ken’s tip does not work for SharePoint 2010 Foundation as these list settings options are not available so you’ll need to use my first suggestion in this case.

Update: And it works for SharePoint 2013 too!

Written by Nick Grattan

April 29, 2008 at 11:10 am