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

One of the first forks in the road when planning a #SharePoint intranet project is deciding whether to go with modern or classic experiences. If you’re looking to take advantage of the latest and greatest, we've got your answer. http://ow.ly/4BrA50z2HQs

It’s official, another 30 days of practicing #SocialDistancing are our future. Another 30 days of #workingfromhome? Have no fear! I have some tips to help you remain close while keeping your distance. http://ow.ly/ezV950z1CRx

A ginormous and heartfelt THANK YOU to everyone who joined us yesterday for "#MicrosoftTeams & #PowerApps - Better Together". We'd like to especially say THANK YOU to Power Platform superstar @aprildunnam for guiding us through this amazing session. Stay tuned for the recap!

Working from home is a wonderful privilege, but we’d be lying to you if we said it came without challenges. Here are a few ‘tips and tricks’ for not just staying sane but excelling in your new environment and finding that ever-elusive work/life balance. http://ow.ly/vrah50yXK5g

Learning about @Microsoft #PowerApps and ⁦@MicrosoftTeams⁩ from ⁦@aprildunnam⁩ during ⁦@pixelmillteam⁩ webinar in the #mancave today. #WFH

Subscribe to PixelMill's
E-news

* indicates required

Let's Talk Digital
Workspaces Today

Get In Touch