Andrew Connell

Hiding field controls in a page layout from presentation...

Ever want to provide certain field controls to your content authors when editing a page, but never have that content appear in presentation (or display) mode? No custom code needed! One of the server controls that ships with MOSS is the EditModePanel. This control, available to developers/designers in the SharePoint Designer Toolbox under SharePoint Controls / Server Controls (SharePoint), when dropped on a page layout, will only render it’s contents when you’re in edit mode. If someone is browsing the page in display mode, the contents aren’t even rendered out.

There’s a great example of this if you check out the ArticleLeft.aspx page layout included in the Publishing Portal site template. Go into the Press Release section of a site collection created using the Publishing Portal template and create a new page using the (Article Page) Article page with image on left. Notice how there is a place to select the rolloup image? When you publish the page, notice that image you selected isn’t rendered. I’m sure this will come in handy to many folks.

Andrew Connell
Founder & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to delivering industry-leading on-demand video training to professional developers. He lives with his wife & two kids in Florida.