PANVEGA’s Blog

DotNet Development, SharePoint Customizing, Silverlight, MS Infrastructure and other tips and tricks

Archive for the ‘MasterPage’ Category

Add a Custom Application.master by using the HttpHandler

Posted by PANVEGA on September 3, 2009

In this post I am going to show you how to apply a custom Application.master to your ShareP0int application by using the IHttpModule. My approach was to create an “HttpHandler” that simply would override the “Page_PreInit” method and change the master page.

Of course you have to create a solution in order to deploy your CustomApplication.master to the 12 Hive folder (e.g. LAYOUTS\CustomMaster\CustomApplication.master). The path to your master page in your 12 Hive and  in the code below should be correct.

page.MasterPageFile = “/_layouts/CustomMaster/CustomApplication.master”;

After you activated the feature and you want to load a page setting for instance, Sharepoint should now apply your custom master. Read the rest of this entry »

Advertisements

Posted in C#, DotNet, MasterPage, MOSS, Object Model | Tagged: , , , | Leave a Comment »

Using SPWebConfigModification within a Feature Receiver

Posted by PANVEGA on September 2, 2009

Sometimes when developing moduls for SharePoint you have to register these modules in your application web.config. You can easily do this by using the SPWebConfigModification class in combination with a feature receiver.

This class holds modifications that are made to the web.config.

Quite often I have to make some changes in the web.config files of the web applications where my solutions are to be deployed. Manifest.xml files of Sharepoint Solutions helps us with this task providing us with some easy ways to alter the web.config files, unfortunately, we are limited at registering safe controls and alter security policies which sometimes is not enough. Read the rest of this entry »

Posted in C#, Deployment, MasterPage, MOSS, Object Model | Tagged: , , , , | 1 Comment »

CSS Styles for your GlobalLinks in the Core.css

Posted by PANVEGA on July 13, 2009

So usually Mozillas Firebag or IE´s DeveloperTool bar are perfect for editing the CSS Styles for your SharePoint pages.  But sometimes there are some fairly hard styles to catch though, even with the assistance of on of these add-ons. Within your SharePoint site you want to customize the colors or background a little.

Generally, styles I primarily use to change the main elements of Site Actions are as follows, though a quick search for “ms-menuUI” in core.css will lead you to the quick realization that this list is not near exhaustive:

DO NOT MODIFY THE CORE.CSS. But the classes into a seperate CSS file and reference it in your MasterPage. Read the rest of this entry »

Posted in CSS, MasterPage, MOSS | Tagged: , , | Leave a Comment »

Custom SharePoint TreeView Navigation with CodeBehind

Posted by PANVEGA on July 12, 2009

In this short post I gonna explain how easy it is to customize your tree view navigation. In one of my prevois post I explaind how to customize your QuickLaunch Left Navigation in your MasterPages ASP:Menu properties. However the confiuration at this point was limited. I needed a dynamic 3 Level with an automatic expaned and collapse menu.

Read my previous post first:

https://panvega.wordpress.com/2008/04/18/customize-the-sharepoint-navigation-aspmenu

You can solve this problem by using asp:TreeView control: Read the rest of this entry »

Posted in C#, DotNet, MasterPage, MOSS | Tagged: , , , | 3 Comments »

Receive a detailed Error Message from a SP MasterPage

Posted by PANVEGA on July 9, 2009

By default you receive an “An unexpected error has occurred” in your MasterPage when you try to make any special changes. However this gives you not the information you expect when customizing your Master Page.

What to do:

Enabling stack traces and disabling custom error pages in web.config is a great way to help you diagnose the specific problems.

You can do this by setting <customErrors mode="Off" /> in web.config and

the CallStack="true" property in the <SharePoint><SafeMode> tag in web.config.

More Information about custom Error Messages:

http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx

Posted in Administration, MasterPage, MOSS | Tagged: , , | Leave a Comment »

Deployment for a Custom SP PageLayout

Posted by PANVEGA on June 25, 2009

In this post I gonna explain in a few steps how to build a SharePoint Feature for a PageLayout. To do this, I needed to create a new page layout based on an existing layout, make this part of a feature and pull in all the bits and pieces necessary to deploy this as a feature.

First I copied a default PageLayout (Welcome Page) with a Fields from this Content Type.The Content Type Group is the default Page Layout. To do This opnen the _catalogs with the SP Designer. Now you have the basic aspx files you will modify and put back into SharePoint as a feature. Open the aspx page in an appropriate editor. Make the appropriate modifications and save the file.

Read the rest of this entry »

Posted in Deployment, MasterPage, MOSS, PageLayout, SPDesigner | Tagged: , , , , | 1 Comment »

Custom Silverlight Navigation with the SP PortalSiteMapProvider

Posted by PANVEGA on June 2, 2009

In this post I wanna explain in a few steps how to develope a custom Silverlight Navitgation for SharePoint publishing sites (Source Silverlight Blueprints on CodePlex)

SharePoint and Silverlight Blueprints on CodePlex were uploaded to include two more Silverlight RTM samples: custom navigation in SharePoint and the colleague viewer. These blueprints provide samples for you to build and explore using Silverlight as an alternate way to develop and integrate powerful user experiences within SharePoint and add rich Internet application functionality to your SharePoint sites. Included in the overall set of samples are a Hello World sample, a Slider sample, and the recently added Custom Navigation and Colleague Viewer samples added

Read the rest of this entry »

Posted in ASP.NET, C#, DotNet, MasterPage, MOSS, Silverlight | Tagged: , , , , , | 1 Comment »

Custom Table Format with the SP HTML Webpart

Posted by PANVEGA on June 2, 2009

When editing content in a SharePoint Publishing site, you can select from 5 predefined table formats when inserting a table. The image on the left lists the table formats available to select from. Although the table formats are worth consideration, they may not match the unique fonts, colors, and other branding defined elsewhere within your web site.

Microsoft Office SharePoint Server 2007 includes an advanced Rich Text Editor that supports predefined table formats. The Rich Text Editor in SharePoint Server 2007 reads the predefined table formats from cascading style sheets that are linked to the page.

You can view the OOTB styles by going to “http://yourportalsite/_layouts/1033/styles/HtmlEditorTableFormats.css


TableTemplate

Read the rest of this entry »

Posted in CSS, MasterPage, MOSS, WebParts | Tagged: , , , | Leave a Comment »

Custom CSS Styles in the SP RichText Editor DropDown

Posted by PANVEGA on May 26, 2009

When creating content on a publishing site through a Page Content HTML editor there are some basic styles that come OOTB: The styles are actually conditional and different styles appear based on the type of content selected. Create your own set of standard header and section styles that are easily available to your content authors directly within the content editor.  These styles appear in the seldom-used “Styles” menu within the content editor toolbar.  By default, you’ll notice this menu is populated with three header styles that are just about everything but useful. Read the rest of this entry »

Posted in CSS, MasterPage, MOSS, SPDesigner, WebParts | Tagged: , , , | 1 Comment »

How to add a second SiteMapDataSource and ASPMenu into a MasterPage

Posted by PANVEGA on May 2, 2009

In a new project, I was asked to add a second QuickLaunch Navigation into a MasterPage.  The second Navigation should get a new custom CSS SiteMapProvider should start at a specific sub node.

Just go to the Sharepoint:SPNavigationManager tag search inside after SharePoint:AspMenu. You see the QuickLaunchMenu is consuming the SPNavigationProvider from the SiteMapDataSource.

However the second ASP:Menu “QuickLaunchMenuTwo” is using the SPNavigationProvider. You see how easy it is to add more SiteMapProvider to more than just one ASP:Menu in your MasterPage Read the rest of this entry »

Posted in MasterPage, MOSS | Tagged: , | Leave a Comment »

SharePoint Navigation Fly-Outs problem with IE8

Posted by PANVEGA on April 8, 2009

Problem:

I configured the SharePoint QuickLinks Navigation SiteMapProvider properties to show a FlyOut menu. However after installing IE 8, the Flyouts were shown in a white box without any content links.

Approach:

Add this meta Tag to your MasterPage between the <head> tages.

<meta http-equiv=”X-UA-Compatible” content=”IE=IE7″ />

<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ />

The first will force a page to render in IE7 mode no matter what, and the second forces a page to render as IE7 would have rendered it historically. The difference being the EmulateIE7 meta tag will force the browser to look for a DocType before rendering in IE7 mode and if it does not find one it will render in Quirks Mode. This is the correct behavior for how IE7 used to render pages and I believe the correct one that should be added to all custom current version SharePoint  master pages. Read the rest of this entry »

Posted in IE, MasterPage, MOSS | Tagged: , , | 3 Comments »

How to retrieve Sites and Pages from the SiteMapProvider recursively

Posted by PANVEGA on April 8, 2009

In this short post I gonna show you how to retreive  a SharePoint SiteMapProvider here CurrentNavSiteMapProvider (LeftNavBar) in your MasterPage and create a XML file where you gonna write the XmlNodes in a hierarchigal structure. You can use the XML for instance to add the control into your MasterPage and parse the Navigation Tree with Silverlight, JavaScript or Flash in order to get your custom animated SharePoint Navigation.

Sharepoint is going to build you a sitemapprovider based off your logical architecture of your site. So, if you site has a root site and it has children and it’s children have children – then the sitemapprovider it creates for you will look like that.

Read more about SiteMapProvider and how to customize in one of my previous post:

https://panvega.wordpress.com/2008/04/18/customize-the-sharepoint-navigation-aspmenu

Provides PortalSiteMapNode objects that represent a merging of the Windows SharePoint Services 3.0 SP Navigation store and dynamic site structure, including sites and pages.

 Read the rest of this entry »

Posted in Flash, MasterPage, MOSS, Object Model, SideMapProvider, Silverlight, XML | Tagged: , , , , , , | 1 Comment »