How to remove the custom columns off Wiki pages 

Tags: SharePoint Development

I was building a SharePoint wiki that utilizes custom security on each page depending on who the user is. To programmatically assign the permissions, I leveraged custom columns on the pages to identify what permissions to set. The problem is, whenever you create custom columns in a wiki, those columns show up on all the pages and you can't disable it through the UI. See below:

 

It's really easy to remove these columns from showing on the pages. Start by editing the wkpstd.aspx page under DocumentTemplates:

 

 

Find the PlaceHolderMain content place holder, and therein, delete the table containing the ListFieldIterator control:

 

 

That's it!

 

Phil

 

<update 1/6/09>

 

I got some good feedback from a few individuals on a few more options to removing the columns. Ray Gaida mentioned you can override a CSS style to remove it. Just drop a content editor web part on the page with the following style in it:

<style>
.ms-formbody{
display:none;
}
</style>

 

Also, Keith Dahlby mentioned a programmatic way to hide the columns by changing the ShowInDisplayForm field property to false. Read more here.

 

Thanks for the tips guys!

 

</update>

 
Posted by Phillip S. Wicklund on 29-Dec-08
8  Comments  |  Trackback Url  | 0  Link to this post | Bookmark this post with:        
 
Failed to render control: Value does not fall within the expected range.

Comments


Mossy Vanossycommented onMonday, 29-Dec-2008
"Start by editing the wkpstd.aspx page under DocumentTemplates: " Gee Phil, I remember you saying to NEVER edit files in the hive.


Phil Wicklundcommented onFriday, 2-Jan-2009
:) - never edit files DIRECTLY to the 12 hive, aka, edit them in visual studio and then deploy them to the 12 hive via a solution. I think that's what I've said in the past.

Other than that, my rule of thumb is don't overrite files you can copy/paiste and make your own, eg. featuers, site definitions, etc.

I didn't have the time to come up with an elegant solution for this page, so I just made the changes to it. Could be a problem if a service pack overwrote my changes, but some times the best value to the customer is quick and easy.

Phil


Mossy Vanossycommented onTuesday, 6-Jan-2009
Just trying to keep you honest there Phil :) Quick and easy - a rarity in the SharePoint universe. Thanks again for the tips.


Ray Gaidacommented onTuesday, 6-Jan-2009
If there are only a few wiki pages that need this removed, you could add the following to a content editor web part and add it to the wiki page:


Ray Gaidacommented onTuesday, 6-Jan-2009
If there are only a few wiki pages that need this removed, you could add the following to a content editor web part and add it to the wiki page: <--! -->


Ray Gaidacommented onTuesday, 6-Jan-2009
If there are only a few wiki pages that need this removed, you could add the following to a content editor web part and add it to the wiki page:


Mehul Bhuvacommented onFriday, 6-Feb-2009
Hi, Nice post, but how do you hide the Edit link in the Wiki toolbar, since all users have the Contributor access in the Wiki Document library. Is there anything OOTB ?


Alexwebmastercommented onTuesday, 3-Mar-2009
Hello webmaster I would like to share with you a link to your site write me here preonrelt@mail.ru