Previously, I’d been asked to put a web part zone below the quick nav for SharePoint pages. As it transpires, you can’t put web part zones on master pages – but there is no reason why you shouldn’t put one in an asp:Content control (indeed, that’s how you have to place them on pages). And I’d noticed this PlaceHolderLeftActions content placeholder. So I figured, why not put my web part zone into that?
To do this, I need to modify the page that I want this zone to appear for. It could be a Page Layout for publishing pages, or just a normal default.aspx on a team site. I’m using a blank site for this. I simply added a Content control, and dropped a web part zone into it:
<asp:Content ContentPlaceHolderId="PlaceHolderLeftActions" runat="server">
<WebPartPages:WebPartZone id="g_5AD648BF053647678E80875B48A60593" runat="server" title="Zone 1">
I saved the changes, and now when I go to edit that page I see:
Great! I can drop in web parts – here I’ve used a summary links web part:
But you may find the styling leaves something to be desired – but you can design that in!
Sure, you could find that you have to do this a lot of times if you want to do this for many pages, but if you’re using the publishing features, you only have to modify each Page Layout once, which is very handy.
8 thoughts on “Putting a web part zone below the quick navigation menu”
Great article. exaclty what I was looking for. Good thinking in adding it to the content control and overrriding the placeholdercontrol.
I’ve modified the page layouts for the standard sts site to include a new web part zone. Works fine, I can add my content to the zone.
Odd thing happens though. After an undetermined amount of time, the content in that zone is dumped, landing at the bottom of the page, below the footer, not in a web part zone.
Hmm. That’s what happens when the web part zone that your web part is in doesn’t exist – it seems to get dumped in the ‘last’ one on the page.
Is your page layout being reset or anything?
I seem to have the same problem as BobC; As far as I can see nothing is resetting page layout unless there is some hidden job?
This is most annoying as I want to make use of the white space under menus any ideas?
I was wondering if PlaceholderLeftActions has some special purpose and the webparts get reset to last on page.
Hmm. Did a bit of a check – some page layouts do insert blank content into the already blank placeholder – I wonder if that’s what’s happening? It doesn’t sound like it based on BobC’s description.
I’ve not seen anything like that, though.
NO its not recommened way of doing.
1. You can only add static web part in master page(outside web part zone), you cannot add dynamic one in master page.
2. You should not place the web part in any , everything inside this tag will be replaced by content page. Instead, you should drag & drop the OOB web part in side standard HTML tags. For example, I drag & drop a OOB Tasks web part inside a , and it shows up in both SPD and site.
Not a recommended way of doing what?
Yes, you aren’t able to add a web part inside a web part zone on a master page (Heck, you can’t even add the web part zone). Indeed, I don’t think that I was able to add one outside a web part zone either, all of which matches the thread you’ve linked to.
What I was trying to do, though, was put a web part zone below left navigation – so that content authors could put useful web parts in there. Overriding the PlaceHolderLeftActions content placeholder did that correctly, and no differently to what happens with the PlaceHolderMain. You do need to be careful, though – some pages (in blogs and wikis particularly) do use the PlaceHolderLeftActions content area.
I’m using asp.net (C#).
I’m working on webparts. I’m able to move the controls from one WebPartZone to other easily. When I move the controls from WebPartZone1 to WebPartZone2, then all the controls (which are in Zone1 and Zone2) were appearing in WebPartZone2 only.
But, actually, my requirement is, whenever, I move the controls from Zone1 to Zone2, then automatially, the controls in Zone2 will have to move to Zone1 (similary to iGoogle).
Can anyone please help me on achieving this.
Thanks in advance,