1/29/2012

SharePoint 2010: Cannot find ContentPlaceHolder 'PlaceHolderLeftActions' in the master page '~masterurl/default.master' #sharepoint #sp2010

 

A simple error caused by a minimal problem   ;-)

image

 

The odds are you or someone on your team was playing with master pages and set the minimal.master as the default master page. As the minimal master is not a complete master page, some of the place holders needed by many pages are missing.

 

SharePoint Designer

To fix, just go to SharePoint Designer and reapply the v4.master (or which ever master you normally use.)

    image

 

Site Actions, Site Settings

The Settings page has a fall back master page (Simplev4.master) to use whenever there is an error loading a master page. So if you don’t have SharePoint Designer available, and you are using a site based on a publishing template, then you can just navigate to the Site Settings page and pick a master page there.

http://yourserver/sites/yoursitecollection/_Layouts/settings.aspx

or just go directly to:

http://yourserver/sites/yoursitecollection/_Layouts/ChangeSiteMasterPage.aspx

Note, this only works with sites with the publishing features enabled.

.

1/22/2012

Cincinnati SharePoint User Group Lightning Round in February!

 

The Cincinnati SharePoint User Group meets the first Thursday of every month at 6:00 PM at MAX Technical Training in Mason, Ohio (directions). The next meeting is 2/2/2012.

 

Lighting Round!

February  is our "Lighting Round" meeting where everyone is welcome to submit a proposal to speak for anywhere from 5 to 15 minutes. These have been a lot of fun in the past and no matter your interest in SharePoint, there will be something interesting!  (Think “SharePoint Saturday in 90 minutes”)

If you have never spoken at a SharePoint user group meeting before, this is just about the easiest way to get started. Pick your favorite aspect of SharePoint, or the latest cool SharePoint related thing you have done, and tell us about it. You don't even need slides, and if you do create slides, you probably won't need more than five or so. Keep it short, keep it interesting and have fun! (And when you are done, you can put "User group speaker" on your resume and be well on your way to SharePoint Saturday fame!)

We are looking for topics like these:

  • administrator
  • developer
  • best practices
  • worst practices / war stories / don’t try this at home
  • end user
  • site owner
  • customization tricks
  • SharePoint Online / Office 365
  • SharePoint for small groups and / or non-profits
  • or anything interesting about SharePoint!

But… no sales pitches!

 

To get the ball rolling I will start us out with this little presentation...

How to Give Back to the SharePoint Community with a Blog and the MSDN Forums
In 10 minutes we will create a blog site, do a little customization, setup an automatic Twitter feed and configure Google Analytics so you will know if anyone is reading your blog.
In the next 5 minutes we will setup an MSDN Forums account and start answering questions!

 

Now it’s your turn!

 

Send us a one paragraph topic proposal and your estimate of presentation length. If you don’t know how to reach me or someone in the user group then just post a reply to this article with your email address and I’ll get back to you. Don’t worry about your email address as I will keep your reply unpublished and private.

 

Mike

 

p.s. If there’s anyone reading this from “vendor land” and you would like to make a door prize donation to the Cincinnati SharePoint User Group, or even sponsor a meeting, please contact me.

 

.

1/19/2012

What Time is it in SharePoint Land? (I missed your meeting because of the time listed in the calendar!)

 

Luis is SharePoint user working on a SharePoint installation installed in the corporate headquarters in Los Angles. The server there is setup on Pacific Time (UTC-08:00). Sam is a team member based in the Atlanta office who has changed his Regional Settings to Eastern Time (UTC-05:00).

Sam schedules a Team Meeting for 10:00 AM.

image

Luis checks the team calendar as sees:

image

Luis is in Chicago, knows that Sam is in Atlanta and is wondering why Sam scheduled a meeting for 7:00 AM! Which… is 6:00 AM in Chicago!

 

So What Time is it in SharePoint Land?

Sam did schedule the meeting for 10:00 AM, his time, which is 9:00 AM in Chicago. The problem here is that Luis has never set his Regional Settings and is seeing the server’s default time, which is Pacific.

 

How do we fix this?

If most of the site’s users are in the Chicago area, then we could change the site’s regional settings to Central time. This won’t bother Sam as he has set his preference for time zone in his regional settings. This solves the problem for Luis and other members of the team in the Central time zone. But… it may confuse users back in the home office where they are in Pacific time.

 

What to do?

A) Tell everyone that all times will be in headquarter’s time (Pacific)
  or

B) Train everyone on how to set their time zone preference
  or

C) Create some automation (PowerShell) to update everyone’s time zone based on the region they work in

 

How to change the time zone for the server

Central Administration –> Application Management –> select your application –> in the Ribbon click General Settings, and General Settings and then change the time zone.

How to change the time zone for a single site

Site Actions –> Site Settings –> Regional Settings –> Time Zone

How to change the time zone for a single user

Ask the user to visit any site, click their name at the top right of the page (the Welcome menu) –> click My Settings –> Click My Regional Settings –> uncheckmark Always follow web settings –> Time Zone

 

Note that user settings will override site and application settings and that site settings will override application settings.

 

.

1/17/2012

SharePoint Cincy 2012 Early Bird Discounted Registration Now Available

 

 

Need I say more!

Go here http://www.sharepointcincy.com/ and click Register Now before 2/29/12.

 

image

 

.

Adding JavaScript to a SharePoint 2010 Wiki, and other Wiki Tips and Tricks

 

The SharePoint 2010 Wiki has a few interesting changes… some I personally think are oversights, some are SharePoint trying to keep you “out of trouble”.

Some of things I will look at here:

  • Why can’t I see a list of all of the Wiki pages?
  • The Rename Page button in the Ribbon is grayed out!
  • How can I insert JavaScript and other content not supported by the Ribbon? 

 

Why can’t I see a list of all of the Wiki pages?

Well… you can, if you know where to look! To see all of the pages you must:

  • Display any Wiki page (“Home” for example)
  • Click the Page tab in the Ribbon
  • Click View All Pages

              image

You could also just navigate directly to the AllPages page:

http://yourserver/sites/Training/YourWiki/Forms/AllPages.aspx

As neither of the above is going to be intuitive to your Wiki users you may just want to add a hyperlink to the home page of your Wiki called Index or Table of Contents.

image

 

 

 

The Rename Page button in the Ribbon is grayed out!

You have to be in the Edit mode before you can rename a page.

  • Display the Wiki page
  • Click the Page tab in the Ribbon
  • Click Edit
  • then click Rename Page

Warning: Exiting Wiki links to this page will get updated. For example, my original link was “Other Resources”. When I renamed the page to “SharePoint Blogs” the other pages where updated from [[Other Resources]] to [[SharePoint Blogs|Other Resources]].

 

 

Adding JavaScript to a Wiki Page

Let’s say you wanted to add a hyperlink to you wiki that links to an external page, and your corporate policy says that you must warn users that by clicking the link they are leaving the safety of your site. Just about every way of adding JavaScript to a Wiki page gets intercepted by SharePoint and the “offending code” is striped out.

     image

I even got creative and tried:

  • Editing the page in the browser and using the HTML button in the Ribbon
  • Editing the page in SharePoint Designer
  • Opening the page source from SharePoint Designer using Notepad, and then saving directly to the Wiki library

In all of these, SharePoint stripped out <script> blocks and converted hyperlinks with JavaScript to useless tags. For example:

   <a href="JavaScript:alert ('hello')"> say hello</a>

got converted to:

   <a>say hello</a>

 

The solution, like so many JavaScript tricks, uses the Content Editor Web Part.

In the example below I have a Wiki page for SharePoint blogs. For each blog I want to have a link to Bing to search for articles from each blog. These links must also display a warning about leaving the site.

The hyperlink looks like this:

Go search <a href="javascript: if ( confirm('This web site is external to the company and may not be safe!') ) { document.location='http://www.bing.com/search?q=site:techtrainingnotes.blogspot.com'; }">Bing</a> for more on this blog!

 

Steps:

  1. Edit the Wiki Page (display the page, click the Page tab in the ribbon and then click Edit)
     
  2. Click where you need the link, and then from the Insert tab in the ribbon click Web Part
     
  3. Click the edit dropdown on the web part and click Edit Web Part
     
  4. Click in the Content Editor’s text area and then click the HTML button in the ribbon
     
  5. Add your JavaScript, save and test

The Content Editors:

image

 

The resulting page after the user clicked the hyperlink:

image

 

.

1/13/2012

SharePoint: Hide List and Library Column Headings

 

I have updated the “Hide List and Library Column Headings” article to add notes for SharePoint 2010 and Office 365!

Go here for the details: http://techtrainingnotes.blogspot.com/2009/06/sharepoint-hide-list-and-library-column.html

 

Before (2007):

image

After (2007):

image

 

Before (2010):

image_thumb[3]

After (2010):

image_thumb[1]

Note: after this customization the checkbox column disappears, at least until you mouse over a document. Bug? I think it’s a bonus!

 

 

.

1/07/2012

SharePoint: Move the “Add New” Link to the Top of the Web Part

 

When you display a long list in a web part you will find that the “Add new” link is often out of sight at the bottom of the page. Your users will have to scroll to the find the link. This article takes a look at some JavaScript to change the order things are displayed in a web part.

 

The before and after:

image

 

Note: This has been tested on only one SharePoint 2010 installation, so use at your own risk and test, test and test.

 

Steps to make this change on only one page:

  1. Open Notepad and paste in the JavaScript from below
     
  2. Save the Notepad file with a name like "MoveAddNewItem.html"
     
  3. Upload this Notepad file to a library such as "Site Assets", "Site Files" or other library
     
  4. Go to that library, right-click this file and copy the Shortcut (the URL to the file)
     image
     
  5. Add a Content Editor Web Part below the last web part on the page, edit this web part, and paste the URL you just copied into the Content Link box.
    image
     
  6. Save your changes and test the result

 

Steps to make this change for all pages:

  1. Using SharePoint Designer, edit your master page
  2. Add the JavaScript below just before the </BODY> tag

 

The JavaScript

Notes:

  • The Try Catch is to deal with the picture library and the calendar, which do not add the “add new” links
  • If you are modifying the code, you will want to remove the Try Catch during your testing
  • The test for "ms-bottompaging" is for long lists that are displaying a previous / next links
  • The line that starts with “theTable = x” is one long line  ( theTable = x[i]…… )
<script>
// CEWP trick from techtrainingnotes.blogspot.com! 
// techtrainingnotes.blogspot.com/2012/01/sharepoint-move-add-new-link-to-top-of.html
// Find all tables
var x = document.getElementsByTagName("TABLE"); 
var ListList = "";

for (var i=x.length-1; i>0; i-- ) 
{
  // find just the tables that are list web parts (have a "summary" element)
  if (x[i].summary)
  {
    try {
      // Now find the "add new" rows
      var theTable = x[i].parentNode.parentNode.parentNode.parentNode.nextSibling;
      // but if the table is the paging table (next / previous) then get the next table
      if (theTable.innerHTML.indexOf("ms-bottompaging") > 0)
      {
        theTable = x[i].parentNode.parentNode.parentNode.parentNode.nextSibling.nextSibling.nextSibling;
      }

      // hide the unneeded horizontal line
      theTable.rows[0].style.display="none";
      // hide the extra blank space
      theTable.rows[2].style.display="none";

      // move the table    
      var theContainer = x[i].parentNode.parentNode.parentNode.parentNode.parentNode;
      theContainer.parentNode.insertBefore(theTable,theContainer);
    }
    catch (err123) {}
  } 
}

</script>

 

.

My Blog’s Year in Review…

 

I’ve seen that a number of bloggers have posted a “year in review” article, and someone asked where mine was, so…

 

2011?

 

79 blog posts

Spoke at 7 events including user groups, SharePoint Saturdays and SharePoint Cincy

Volunteered at TechEd in Atlanta

Wrote a book!

Wrote a magazine article

Taught way too many classes (my day job!)

Updated two courses we have in the Microsoft Courseware Library (CWL)

Got about 3000 points answering questions in the MSDN forums (but I still don’t know what a point is)

Even got in about 100 flights on my R/C airplanes!

 

2012?

 

The blog? I have a lot of started, but never finished blog articles left over from last year, so I’ve got plenty of topics

Speaking? Already scheduled to speak at SharePoint Cincy 2012 and at the SharePoint Summit 2012 in Toronto, with a few more events pending

Going to the MVP Summit in Redmond!

Planning on TechEd again this year in Orlando (fingers crossed)

Books? Two outlined, and one in progress…

Magazine articles? In the works…

Classes? I’m sure I’ll be busy. It’s my day job you know.

New courses? A new SharePoint Designer 2010 class scheduled for completion by the end of the month and probably five or six others by the end of the year.

MSDN forums? I’m in there almost every day so I’m sure I’ll get more “points”.

Definitely a lot of R/C airplane and helicopter flying in the plans.

 

 

There… I did my mandatory year in review, and even did a 2012 forecast…

 

.

1/05/2012

Cincinnati SharePoint User Group Meeting Tonight!

 

Last minute reminder…

Meeting agenda

Date:         January 5, 2012, Thursday
Time:         6:00 – 8:00 pm.
Where:       Max Technical Training, 4900 Parkway Dr. #160 Mason, OH.  
                  Click on the link for directions  http://www.maxtrain.com/directions/
Schedule:
6:00 – 6:25 - Socials and Networking - No Registration required
6:25 – 6:30 - Introduction of Agenda and Speakers
6:30 – 8:00 - Presentation

Creating SharePoint Designer Workflow Solutions End-to-End
Mark Tiderman Jr of MTech Solutions

8:00 – Door prizes!

 

.

1/02/2012

SharePoint: Not all column types can be used in Calculated or Lookup columns (plus a trick to add back four of them!)

 

A recent question in the MSDN forums got me to looking again at the limitations on the use of certain column types in calculations or lookups. The list of column types that can be used in lookups is quite limited, but with a trick using a calculated column we can add four more to the list.

 

For my test I added all of the following columns to a custom list. These include the basic columns plus a few variations of options including each type of calculated column.

image

 

Types that work for a Calculated column

I then added a Calculated column. This is the list of fields offered for use in a calculation:

    image

Not included in this list were these columns:

    image

 

Types that work for Lookups

I then added a lookup column to another list to see which column types could be used for lookups. Here’s what shows up:

    image

The only column types available for lookups are:

    image

And when a lookup has been selected, here is the list of columns that can also be displayed from the lookup list:

    image

Or, just these types:

    image

So, these are excluded from lookups:

    image

 

A workaround for some missing lookup column types!

If you look back at the types that did show up in the list for lookup columns you will find:

    image

And if you go back to the list of types that can be used in calculated columns you will see that we can create calculated columns for some of the missing lookup types, as long as the calculation returns “Single line of text”!

With a calculation we now get to:

  Yes / No

  Choice (Drop-down or Radio Buttons, but not checkbox)

  External Data (and external data additional columns)

  Currency (but without the currency ($) symbol)

The calculation for Choice and External data is pretty straight forward:

   =[fieldname]

The currency type will just return the value, with commas and decimal points. You may want to add the currency symbol.

   =[fieldname]

or

   =”$” & [fieldname]

The Yes / No is a bit of a problem as the simple calculation just returns a 0 or 1. To get the words Yes and No you will need to do just a little more work:

  = if( [yesnofieldname], “Yes”, “No” )

Remember for all of these you will still need to set the "data type returned" to "Single line of text".

 

A few additional resources for what column types work where…

 

SharePoint Columns – Features and limitations

http://www.sharepointusecases.com/index.php/2011/07/sharepoint-columns-features-and-limitations/

 

Create list relationships by using unique and lookup columns

http://office.microsoft.com/en-us/sharepoint-server-help/create-list-relationships-by-using-unique-and-lookup-columns-HA101729901.aspx

 

Column types and options

http://office.microsoft.com/en-us/sharepoint-online-enterprise-help/column-types-and-options-HA010302193.aspx?CTT=1

 

SharePoint 2007 Supported Lookup Column Types

http://sharepoint.nauplius.net/2010/09/sharepoint-2007-supported-lookup-column.html

 

.

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.