Skip Ribbon Commands
Skip to main content

Point2Share | Daniel McPherson's SharePoint Blog

:

The zevenseas Community > Blogs > Point2Share | Daniel McPherson's SharePoint Blog > Posts > WebPartOrder not being respected
November 14
WebPartOrder not being respected
Someone mailed me asking me to repost this one from my old Point2Share Blog, so here it is!
 
I lost a couple of hours of my life today working on a really simple problem and so I thought I would just put a little tip out there in case anyone else bangs their head against it.
 
All I wanted to do was put some web parts, on a web part page, in a particular order, via an ONET.XML file. Simple right? All you need to do is give them sequential WebPartOrder values and away you go!
 
I did this, tested, and found that while the web part went in the correct zone (one on the right) they were going in with the wrong order. No matter what I tried (and I tried everything, was it alphabetical, the order in the ONET.XML, reverse WebPartOrder, argh!) I just couldn't get them to display the way I wanted.
 
Now this sort of thing is really ONET.XML 101, so it frustrated me even more. Taking a break from the problem last night I returned today to find it was actually pretty obvious. You have to make sure you get your Web Part Zone ID correct.
 
A tip, to be 100% sure of the ZoneID, export a web part from the page which is in the Zone you are interested in then examine the .dwp (or .webpart) file, or, better still, take a look at the Layout page looking for the specific WebPartZone tag, and then grab the ID attribute.
 
I think the reason it took me so long is that the web parts were going in the correct zone, what would have been better is if they gave some sort of error, like "Web Part Zone not found", or simply didn't appear on the page. I'm not sure how SharePoint selects the zone to place web parts when it is faced with an invalid Zone ID, but it seems I was partially a victim of coincidence.

Comments

Matthijs Wensveen

Hi Daniel,
I can't get this to work. I'm 100% sure that I have the correct WebPartZoneID's because I created the page layouts myself.
Do you know of any other reasons why this could go wrong?

Thanks in advance,
Matthijs
System Account on 13/04/2010 06:06

Having a similar issue

Matthijs are / were you using sharepoint 2010, I am having a similar issue. WebPartZone is correct but the webpart are in the incorrect order ... annoying.
 on 30/06/2011 04:37

Add Comment

Title *


Body *


CommentUrl


CAPTCHA *

 

Attachments

 

 Statistics

 
Views: 691
Comments: 2
Tags:
Published:1645 Days Ago