As you know when you add a web part to a library page, like Allitems.aspx or a page of a custom view that you’ve made, the ribbon gets wacky. That’s because it doesn’t know which web part it should have its focus on.
So what could we do if we really want some information, let’s say above the library web part?
And the information should be able to edit in an easy manner without using SharePoint Designer (SPD).
In this example I have a top site and underneath this I have some sub sites that are created from a site template I made. The things we are going to do now is made to that template so it could be reused.
First of all we have to edit the page’s code a bit, so bring up the page in your favorite editing tool SPD!
Find where the web part zone for the library begins and add two DIV’s right before it starts, like this:
PlaceHolderMain" runat="server"> <div id="success"></div> <div id="error"></div> <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main">
As you can see I have added two DIV’s right after PlaceHolderMain with the ID’s of success and error. Don’t close this page, we are coming back here real soon.
What we are going to do now is to add some content to the success DIV.
First we need to have some content, right?
On the top site, let’s create a new Web Part Page, call it content.aspx and choose Full Page, Vertical.
Add a Content Editor to the page, click inside it, choose to Edit HTML Source…
…and paste this code:
</pre> <div id="<span class=">MyDiv"></div> <pre> The content within this DIV will be shown above the document library. <div> <ol> <li>To think about...</li> <li>And this as well...</li> </ol></div></div>
Ok, so now we have som content and as you can see the content is kept inside a DIV with the ID of MyDiv.
Now we are going back to the first page (where we have the library and added the two DIV’s) to add this information to the success DIV.
Let’s add som jQuery!
Find AdditionalPageHeader and add this code:
As you can see, first I have a reference to my jQuery file, you should replace the URL so that it corresponds to your environment.
Then in the next section we are loading the content in MyDiv into the DIV with the ID of success.
Now we are done!
Save all pages and try it, it should look something like this:
This way you can create new sites from this site template and just by editing the Content Editors in the page content.aspx you could update the contents on all sites.
Isn’t that nice?
In a project I recently worked in I found out the hard way that it wasn’t possible to save a Meeting workspace (MW) as a custom template to recreate sites from. I also found out through Bing that I wasn’t alone in my discovery 🙂
The other day I was discussing this with a colleague and by reproducing it I wanted to show him that the left navigation on the site between the different meetings would crack.
So I saved a MW as a new template and from that template I created a new MW from a calendar event. Then I created another calendar event and linked to the same MW. Navigating to the MW I could now see the two dates in the left nav. And do you know what? It worked!
I could actually navigate between the two dates! This has never worked before!
So why does it suddenly work? SP1 for SharePoint 2010 🙂
My colleague who did not have SP1 installed, doing the same thing in his dev environment, got the old behavior, left navigation cracked. After installing SP1 he didn’t have the problem any longer.
Isn’t that great? When SP1 was released I actually went through the Excel file with all the fixes and couldn’t find anything about this. I wish it could have been mentioned, it would have saved me and the client a lot of time.
Another thing to be aware of when you have meeting workspaces in a site collection and you for that site collection, wants to push out a custom master page on all sub sites. If you do that, the MWs will also be getting your custom master page. As you already might know, MWs have their own master page.
To fix this you will have to add this into your custom master page.
At the top add this Tagprefix:
<%@ Register Tagprefix=”Meetings” Namespace=”Microsoft.SharePoint.Meetings” Assembly=”Microsoft.SharePoint, Version=18.104.22.168, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
Below the FORM-tag below the BODY-tag add:
There is one more thing to add to this. In a MW there are two more options in the Site Actions menu.
“Add Pages” and “Manage Pages”. These two options will also be lost when you apply another master page than the default for a MW. I don’t have a solution for how to handle that as for now. But some how I think it’s needed to make the Site Actions menu dynamic and show these options only if the site is created from a MW template.