The reason you get this error is because the user needs “read” access to the Master Page Gallery list. Once that is given, and as long as they have the ability to “add and customize pages” in permission levels, creating pages should work great!
2011
Full-Width Page Layout in Sharepoint 2010
Page Layout without the sidebar (Sharepoint 2010)
In order to create a full-width (whatever the width of your container is) page layout in Sharepoint 2010, you’ll want to disable the sidebar. I find this useful for things like calendars and big lists. Because my design is only 960px wide, I find that by the time you add the sidebar in, you’re left with only around 750px of usable space. For a calendar or a big list, it’s just kind of annoying.
So here’s how it’s done:
Create a new page layout in Sharepoint Designer. Add a new control like this:
<asp:Content ContentPlaceholderID="PlaceHolderLeftNavBar" runat="server" />
By declaring an empty control, we tell Sharepoint to ignore that control and not fill it with anything.
Don’t forget to add a bit of CSS in the header to expand your main body panel to the full width.
Simple as that!
note: use this technique to hide other items on the page layout (top navigation, footer, sky’s the limit)
2011
2-Column Page Layout in Sharepoint 2010
You need a two-column page layout for your Sharepoint project. I’ll show you how to do this with and without the sidebar (quick launch) being active.
Step 1: Create a new page layout
I use Sharepoint Designer for this. I’m not even sure it’s possible using anything else.
Step 2: Setup your basic layout in HTML
You can use tables or divs, but in the spirit of the future, let’s use divs.
<div></div>
<div></div>
<br style="clear:both;" />
Step 3: Fill your divs
Inside these divs you can place webpart zones, page fields, or your own code (maybe a specific header for each column?). Whatever you want to do.
Step 4 (optional): Hide the sidebar/quicklaunch
Declare this control anywhere not the page, but leave it empty so nothing will load into it:
<asp:Content ContentPlaceholderID="PlaceHolderLeftNavBar" runat="server" />
Don’t forget to add a bit of CSS in the header to expand your main body panel to the full width.
Step 5: Style the divs so they appear next to each other.
Using CSS we can make sure those divs appear next to each other.
.col-left,
.col-right {
width:400px; /*obviously…play with the width to match your setup*/
float:left;
}
The <br/> tag above should break after the floated elements so everything remains normal in your page layout.
2011
Master Pages vs. Page Layouts in Sharepoint 2010
For those new to Sharepoint, specifically Sharepoint 2010, here is a primer on the difference between page layouts and master pages.
Master Pages
A master page is what I would normally call something like a template. It holds all of Sharepoint’s necessary elements. It creates containers for your information to load into later. It sets the document structure. An analogy would be an empty bookcase. It’s created a bunch of holding places for different elements. You’ll use some of these elements, and Sharepoint will use the rest. So it’s VERY important to not remove elements in this page unless you really know what you’re doing. You might not need the item, but Sharepoint might need it to run the page correctly.
What Master Pages are used for:
- Calling CSS files
- Installing javascript & other scripts
- Tracking codes (I put my Google Analytics code here)
- Setting top navigation & sidebar functionality
- Things that occur on EVERY page.
What Master Pages are not used for:
- Controlling page-level design and structure
- Webparts and Webpartzones (you can…but I wouldn’t)
- Anything that DOESN”T occur on EVERY page
Page Layouts
In a page layout, you are essentially telling Sharepoint what it should fill all those empty bookshelves with.You declare a control (a certain shelf), and then tell Sharpeoint what goes inside. You can’t go beyond the reaches of the master pages. Whatever controls are on the master page are the controls you can use in a page layout.
What Page Layouts are used for:
- Creating the layout of the pages (within the bounds of the master page)
- Controlling page-level design elements.
- Including page-level css files to override master page styles
- Inserting Webparts and Webpartzones
- Including custom codes (javascript, etc.)
- Things that occur only on this page layout, not site-wide
What Page Layouts are not used for:
- Content. This is not the place to write and display content. You’ll create a page to do that. This is merely to provide the placeholders to do that.
- Applying CSS styles that could be applied at a higher level. You want to keep the management of things like CSS as centralized and high as possible.
A few extra tips:
- You should never need more than 1 master page (unless for some reason you decide you want a different “admin” and “front-end” master page.
- Page layouts should be used sparingly. It can get a bit out of control, so consider what you need and make some generic templates using page layouts that will work for many kinds of pages.
- Don’t put too much extra CSS, javascript, or custom code in page layouts. It can be an enormous task to figure out where a style or a piece of code is coming from if you have master page-level stylesheets, page layout-level stylesheets, and even possibly page-level stylesheets (in a CEWP or something). Try to centralize and simplify.
2011
Sharepoint 在中国
我当前的项目涉及Sharepoint 2010。
How’s that? I’d like to try my hand at writing about Sharepoint in Chinese. My written Chinese is despicable. But I might give it a shot. Who knows, it could open up a whole new base of readers here on the mainland! Although if I do it, I want to write from what I know, and not translate whole paragraphs at a time. Browsers can do that. I’d like to somehow add value in Chinese. We’ll start off slow…
去年我跟朋友去看一个Sharepoint Conference在北京。有意思因为我们听过Dux Raymond Sy, Joel Oleson, & Mark Miller。我很感兴趣找到别的人在中国工跟Sharepoint.
Words I learned this post (at least in writing):
当前 (currently)
项目 (project)
感兴趣 (interested)
Speak Chinese? Leave a comment!
2011
Create a sports team schedule/calendar in Sharepoint 2010
This is a bit of a pigeonholed topic, but nonetheless, it’s a great tool for a specific purpose. And if nothing else, it’s good practice for lookups and views and the relationship between lists. The end result here is a calendar of events, with each event linked to a team. The benefit is that in another view, you can then filter and print that team’s schedule. This was originally built for a school, but can be adapted to other situations I’m sure.
Step 1:
Create a custom Sharepoint list. I called this list “Teams”. Setup your columns as follows:
Team // Single line of text (formerly called Title)
Coaches // People/Group field
Members // People/Group field
Step 2:
Create a Sharepoint calendar list. Setup the columns as follows:
Event // Single line of text (formerly called Title)
* leave normal calendar columns alone *
Team // Lookup field (look up the team names from the Team list)
Step 3:
Create 1 view for the Calendar. This will actually most likely be created for you. Test it out. When you create a new calendar event, you should be able to add a team from the list of teams to this event. So for example:
New Event:
APAC Basketball (the name of the event)
* calendar details *
Varsity Basketball (the team selected)
Step 4:
Create another view called “Team Schedule”. Put the visible columns in the following order:
Event (linked to event)
Location
Start Time
End Time
All Day Event
Team (will be linked to the team details)
In this view, I’ve set it so it only shows events that are happening on or after today. So I’ve set the following filters:
Team is greater than “” (leave the field empty)
AND
End Time is greater than or equal to [Today] (there’s no need to set a start time greater than today, because if you have the end set then you’ll automatically get everything that begins later…or those that began earlier but are multi-day events crossing over today.)
That’s it! So now you have a view where, if everything is setup right, you can filter by the team name in the “Team Schedule” view and it will show all upcoming games of that team. If you click on the name of the team you should be able to see a popup of the details of the team. If you click on the event name you’ll see details of the event.
Note: The reason I’ve included people/group fields for the coaches and team members is because all of those people are in my Sharepoint groups (being pulled from Active Directory), so it’s just a bit nicer to click on the name of the team and see pictures of the coaches and all the team members. You can style this popup to your liking so that you have a really nicely displayed view of the team.
2011
Use a friendly URL in a Sharepoint list display
Is your URL waaaaaaaaay too long for your display form (usually dispform.aspx) in Sharepoint 2010? This is an easy fix.
Step 1:
Create a new display form for your list item in Sharepoint Designer
Step 2:
Find your URL field. My URL is a link to the mysite of a person.
Step 3:
Create a new variable, wrapping what is currently there as your xsl item.
So in my case, I replaced this:
<xsl:value-of select="@MySiteLink"/>
with this:
<xsl:variable name="linktomysite">
<xsl:value-of select="@MySiteLink"/>
</xsl>
Step 4:
Finally, call the variable in a nice short, user-friendly link
< a href="{$linktomysite}">MySite Profile</ a>
