SharePoint 2010: Add a WebPartZone to a Team Site

Have you tried to add a webpartzone to a SharPoint 2010 Team Site page in SPD? You can, but you will find that you cannot add webparts to the zone in the browser. In my opinion this partly defeats the purpose of adding a webpart zone in the first place. But wait, there is really good news!
You probably do not need to add webpart zones to a team site in SharePoint 2010. Why? Well, Team Sites in SharePoint 2010 use a wiki content div which allows you to add web parts directly inline with text in the different zones created in the layout you choose.
If you open up a content page in SPD, look for the following code block:

<SharePoint:EmbeddedFormField id="WikiField" FieldName="WikiField" ControlMode="Display" runat="server">
<div>...
<span id="layoutsData" style="display:none">true,true,3</span>
</div>
</SharePoint:EmbeddedFormField>

This is where the magic happens. SharePoint’s EmbeddeFormField tag inserts a Wiki control into the page in question. The “content” of the control will go where the … are.  What about the span, <span id=”layoutsData” style=”display:none”>true,true,3</span>? This defines the layout of the control. The first boolean value is if a header should be included, the second boolean sets if a footer should be included and the number can be between 1 and 3, which defines how many columns are included. In the example provided,  (header, footer, 3 col). Side note, I have been told quite a few times that there are the only layout options available. If it’s possible to add more layout options, it’s not easy.
What is really cool is that with these layout options and that fact that you can add html, css and webparts all inline with content, you can get almost any layout you want with any mixture of webparts and text, all updatable via a web browser.
Nice huh?

Leave a Comment

Your email address will not be published. Required fields are marked *

Enter Code *

Filed Under

Related

Is your #nonprofit struggling with #internalcomms and effective #collaboration? Join the #PixelMillWebinars on May 27th at 11:00 AM PST to see how we helped @wwp reconnect & #communicate with a modern #SharePoint #Intranet .

http://ow.ly/Nj8u50EGMRO

"Remember, the force will be with you always." - Obi-Wan Kenobi (Star Wars Episode 4 - A New Hope)

Happy #StarWarsDay to all our #PixelFriends across the galaxy. #MayTheFourthBeWithYou

Only 1 hour away from the the doors of the #PixelMillWebinars developer's lab being thrown open and your deep dive into #PnP Modern Search v4 begins! We've got the one and only @EricOverfield here to lead the way.

Don't forget to sign up!

http://ow.ly/3Geo50EATkn

Do you need to build a custom search-driven component for your #digitalworkspace while saving thousands of hours of development time?

Then this session is for you.

Register now and join the #PixelMillWebinars and @EricOverfield today at 11am PST!

http://ow.ly/vFdj50EAS0I

It's the day of the show, y'all!

Join the #PixelMillWebinars in the developer's lab today at 11:00am PST as #Microsoft RD+MVP @EricOverfield lifts the hood on #PnP Modern Search v4.

http://ow.ly/O0QG50EARwm

Subscribe to PixelMill's
E-news

* indicates required

Let's Talk Digital
Workspaces Today

Get In Touch