SharePoint Ribbon Modifications – Ribbon Buttons Too Small

So I was working on getting some content into the top right hand corner of the ribbon and the strangest thing happened: the ribbon buttons began shrinking themselves as if you’ve re-sized the browser. Check out the image below for an example of what happened.

At first, I thought it was due to a rogue style effecting the ribbon buttons, but with a closer examination of the source of my trouble I realized SharePoint was in fact scaling down the ribbon because of a style I set on a container to the right of the ribbon.

The CSS class that was causing my trouble was the s4-trc-container-menu. I mistakenly applied a float: right and a set width. SharePoint didn’t react well to either of those. The ribbon would shrink all the time with it floated to the right. As for the set width, the Ribbon began to display errors for me at about 400px.

Bottom line: Don’t float anything next to the ribbon, it can cause it to behave erratically.


Populating a Drop Down Based on Content Type

Recently, I’ve had to populate a drop down with lists of a certain content type. So, SharePoint offers a great way to filter lists based on content types with their ContentTypes.BestMatch() and .IsChildOf()  functions.

In order to get the content type you’ll need, you’ll have to know the ID of the content type. Theses are pretty cyptic, but you can find a great MSDN Article containing a description of how content types are composed Here.

Continue reading

Styling List View Web Parts – SharePoint 2010

The SharePoint 2010 list view web part can be styled just like anything else, there are just a few key tags you need to hit. I’ve taken the classes and ids you’ll need to hit and gathered them together and added comments to save you the hassle of navigating through SharePoint 2010’s CSS structure.

To get started, first create an additional Style Sheet and link it on the master page you are using on your SharePoint Site. Make sure you put the link to your new style sheet at the bottom of the head tag.

After that, just copy and paste the CSS below into the style sheet that is linked to your custom master page and style away.

Continue reading

Getting SharePoint Search To Work With Anonymous User Access

So, I recently started working on getting SharePoint working as an externally facing site. The more i work with it the more work arounds I end up using.

Getting SharePoint search working was interesting. First of all, since it is externally facing, our configuration require claims based authentication and Forms Based Authentication (FBA) as well.

The first problem I ran into was getting it to work at all on our externally facing site. To do so, I needed to do a few things:

Continue reading

Crawling DotNetNuke with SharePoint Search

I recently encountered a problem that had us all stumped, we could not get SharePoint Search to crawl DotNetNuke successfully.

The problem was attributed to several things:

  1. SharePoint automatically removed the ‘default.aspx’ on folders when crawling and you cannot turn this off
  2. We had DotNetNuke set to use ‘Friendly URLS’ which means it dynamically generates the URL
  3. There was no actual file path when DotNetNuke Generates the URL, so SharePoint does not find anything when it kills the ‘default.aspx’
  4. Active directory authentication in DotNetNuke was preventing the SharePoint crawler from being granted access to the pages it was trying to crawl.
Unfortunately, I couldn’t do the obvious and turn off friendly URLs because the thousands of users already bookmarks and saved pages so it would appear as if many pages were down.
So, to solve this I did three things:
  1. Wrote a console application to generate a file containing the ‘unfriendly’ URLs from DotNetNuke (URLs using the query string to specify the page) then resave the web.config file to force an application pool restart. Also, during this time turn off Active Directory Authentication for about 30 minutes on the DotNetNuke site so the SharePoint Crawler has access to the pages.
  2. Create a Crawl rule in SharePoint Search that searched ‘Complex URLS’ and point it directly at the file generated
  3. Set a timed job on the server to generate a fresh list of ‘unfriendly’ URLs, set the crawler to crawl the DotNetNuke URL file while Active Directory is turned off.
So, all in all we got this to work. You can see the solution wasn’t easy though.