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

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

Join us on as we lift the hood of #PnP Modern Search v4, show you how it's built, & take you on a live coding adventure.

http://ow.ly/MTnL50EpN5J

#Hybridwork is more than just a buzzword to latch onto; it’s the future for many organizations for the unforeseeable future. So, how can you use #Microsoft365 for #hybridwork? Let's breaks it down…

http://ow.ly/ay2e50EmNhg

It's that time again! Join the #PixelMillWebinars on 4/29 where @EricOverfield lifts the hood of #PnP Modern Search v4, shows how it's built, & takes you on a live coding adventure to customizing your own web part using the power of the existing codebase.

http://ow.ly/EI5h50EmNqj

What? Anchor links now work in #SharePoint site navigation! This fix snuck in and I completely missed it. Use them to create a TOC for long pages or cross link between pages. They work in text or quick links web parts & nav too! https://support.microsoft.com/en-us/office/create-and-use-modern-pages-on-a-sharepoint-site-b3d46deb-27a6-4b1e-87b8-df851e503dec#bkmk_pageanchors

A big thank you to David Leveille and @CrushNetworks for having our President + Co-Founder @EricOverfield on this episode of #TheVirtualWaterCooler!

Subscribe to PixelMill's
E-news

* indicates required

Let's Talk Digital
Workspaces Today

Get In Touch