Showing posts with label sharepoint designer. Show all posts
Showing posts with label sharepoint designer. Show all posts

Monday, March 14, 2011

Add global navigation to SharePoint 2010 Search Center

-- 11/29/2011 UPDATE --
Thanks to Falk and Furiant for the comments and troubleshooting. I've added an extra step to account for situations where users have read-only permissions. The corev4.css style sheet does not get loaded by default on minimal.master for these users and therefore does not style the navigation properly.

John Ross from SharePoint 911 has an article that describes why SP2010 search center templates use minimal.master for their master pages.

http://www.sharepoint911.com/blogs/john/archive/2010/05/12/sharepoint-search-center-uses-minimal-master-%E2%80%93-and-why-you-should-care-about-that.aspx

One of the most frequent requests I get from users that have (fairly) vanilla SP2010 deployments is to have the global navigation links included on search pages. The simplest way to do this is to make a copy of minimal.master and copy a div tag from v4.master. Here are the steps:

1. Open SharePoint Designer and connect to the root of the site collection where your search center lives. You’re going to need to access to the master page gallery.

2. Select “Master Pages” from the “Site Objects” pane on the left.

3. Make a copy of “minimal.master” and name it something nice like “search.master”. Open this new master page in split view.

4. Find the div tag that encloses the “PlaceHolderTitleBreadcrumb” content place holder control and paste in this markup (which I just copied out of v4.master) right above it.

<div class="s4-lp s4-toplinks">
    <asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
        <asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
            <SharePoint:AspMenu
                ID="TopNavigationMenuV4"
                Runat="server"
                EnableViewState="false"
                DataSourceID="topSiteMap"
                AccessKey="<%$Resources:wss,navigation_accesskey%>"
                UseSimpleRendering="true"
                UseSeparateCss="false"
                Orientation="Horizontal"
                StaticDisplayLevels="2"
                MaximumDynamicDisplayLevels="1"
                SkipLinkText=""
                CssClass="s4-tn"/>
            <SharePoint:DelegateControl runat="server"
                ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
                <Template_Controls>
                    <asp:SiteMapDataSource
                        ShowStartingNode="False"
                        SiteMapProvider="SPNavigationProvider"
                        id="topSiteMap"
                        runat="server"
                        StartingNodeUrl="sid:1002"/>
                </Template_Controls>
            </SharePoint:DelegateControl>
        </asp:ContentPlaceHolder>
    </asp:ContentPlaceHolder>
</div>

5. Find the CSS registration tag for minimalv4.css and paste in this tag right above it.

<SharePoint:CssRegistration Name="corev4.css" runat="server"/>

6. Save, check in, and publish the new master page.

7. Browse to your search center and change the site master page to use the one you just published. Your global navigation should now show up directly below the dark blue band that has the site logo and title.

Thursday, September 17, 2009

The SPD Workflow History List Conundrum

I have this project that I’m working on that requires a lot of SPD workflows. Some of them are legitimate workflows, while others do quick actions like sending notifications or updating fields. At some point I realized that the default history list that SPD attaches to all workflows is going to get large pretty quickly.

So being a clever guy, I proceeded to write a small utility that would let me create new history lists and associate them with my workflows. I was okay with losing some of the history that would be displayed with the workflow statuses. Boy, what a bad idea…

I had three problems:
1. I couldn’t change the history list for workflow instances that were currently running. This was annoying, but I figured I’d get a chance to do it at some point when the workflows completed.
2. Any changes to the workflows in SPD changed the history list association back to the default one. Also annoying, but I could deal with it.
3. It completely prevented workflows from running. Yeah, I saved the best one for last.

I’ve given up on making this work. I’ll gladly accept any ideas that someone has on the matter (besides creating and packaging the workflows in Visual Studio). My internet searches have been in vain.