-
Removing HTML Person Group Fields in Sharepoint
Posted on October 12th, 2009 2 commentsOver on Stump the Panel, Sasha wanted to change the message being displayed on a Tasks list when no one had a task assigned. The hyperlinks for the Assigned To user on the DispForm and EditForm.aspx pages should also be removed.
First, the Disp/Edit forms. In order to make changes to these pages, we need to employ the tool pane URL hacking method. You’ll need to have a tasks list populated with some data or you won’t be able to see this in action. Click on one of the items to go to the DispForm page. Employ the tool pane hack by appending &PageView=Shared&ToolPaneView=2 to the end of the URL in the address bar and hit Enter. Success, we’re in Edit mode.
Add a content editor web part. Click the source editor button and paste in the following:
Substitute a local path to jQuery if it exists in your environment. You may be thinking to yourself that this script looks familiar, well it should. It is the same script from the employee training admin page modifications only repurposed slightly. I have changed the selector to ms-formbody to isolate the HTML Assigned To field. This makes the hyperlink disappear.
Next step, change DispForm to EditForm in the URL. Add a content editor web part to the page like before. Click the source editor and add the following into it:
Now the underline will be gone from the people picker control.
The original problem was solved by converting the view to an XSLT data view and entering in the default message to be displayed when no items were found. Then Sasha noted that the Assigned To name hyperlink should be removed. This again involved more recycled jQuery code. The XSLT Code for the Assigned To filed looks like this, note we added person as the selector:
<td class="{$IDADW2OC} person"> <xsl:choose> <xsl:when test="@AssignedTo=''"></xsl:when> <xsl:otherwise><xsl:value-of select="@AssignedTo" disable-output-escaping="yes" /></xsl:otherwise> </xsl:choose> </td>And the jQuery to remove the HTML:
Plurk This Post
Buzz This Post
Delicious
Digg This Post Stumble This Post2 responses to “Removing HTML Person Group Fields in Sharepoint”

-
Hello from Russia!
Can I quote a post in your blog with the link to you?
Leave a reply
-



Polprav October 21st, 2009 at 19:31