Showing posts from April, 2013

Consistent Top Navigation Menu across All site collections in SharePoint 2010

Consistent Top Navigation Menu across All site collections in SharePoint 2010
Requirement: Display a consistent Top Navigation Menu across multiple site collections on the same web front ends in SharePoint.

We can fulfill this requirement by using custom sitemap providers in SharePoint. Here are the steps at high level
Create your own sitemap file in Layouts folderAdd a Site Map Provider in web.config fileAdd a SiteMapDataSource to your master pagechange the SharePoint menu's datasource to your custom SiteMapDataSource Lets start building SharePoint 2010 common navigation across site collections.

1. Create your own sitemap file in Layouts folder

Modify the site map to match your navigation needs and save it with a .sitemap extension in a location accessible by your SharePoint farm. The _LAYOUTS\1033 directory is a great place since any site can get to that location (i.e. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\BPCorp.sitemap)


Connect DataView or Drop-down List to SOAP Web Services on same server

Add a SOAP service as a data source To be able to use a SOAP service on SharePoint 2010 as a data source in Designer, you will need to modify the web.config first.  This article explains this:
Refer to this section for the instructions: "Configure the Web.config file on the server".
Follow the directions at the top of the page to connect to the web service.  In my case I am investigating pulling in users in a SharePoint group as a data source for a webpart filter on a page.  The customer wants to filter all the webparts of list views from a drop-down menu built from users in a group local to the site where the lists and page reside.  I will need to allow for the default filter to be null or none, and then allow the filter to be refined by the user.

SharePoint 2010 Modal Dialog Popup for Form

The modal dialog requires JavaScript to open whatever page you would like to see.  This page can be the newform.aspx, a custom form, or a list view.  The modal dialog will open it with presence that darkens the page you open it from.

Place this code in a script block on the page, I use the PlaceHolderAdditionalPageHead region:

<asp:Content ContentPlaceholderID="PlaceHolderAdditionalPageHead" runat="server">
<script type="text/javascript">
function OpenEditDialogUpdate(item_title, item_id){var options = {url:"{9F02637E-A2ED-4B96-B89D-7EC6D38FCFB6}&RootFolder=",width:800,height:700,dialogReturnValueCallback: DialogCallback}; SP.UI.ModalDialog.showModalDialog(options);}
function OpenEditDialogDocument(item_title, item_id){var options = {url:"{BE1FDCF3-D737-4977-B0ED-C4B5D6D7D797}&RootFolder=",width:800,height:370…

Eliminating Duplicates in SharePoint XSLT Data Views or Drop-downs

I may want to create a custom dashboard enumerating all of the unique values from a column in a list.  In my example I have a list of possible releases of software where each has a Product column.  I want to build a menu of all of the Products from this list.

I give credit to this method to Marc Anderson at:


Build SharePoint URL Links Programmatically

I like to use Query Strings as well as building my own navigation links inside SharePoint.  The problem when you create your own menu buttons on a page is that if you use absolute encoded URLs they break if you move the site or rename a parent in the URL.  This takes a little work on the URLs that SharePoint gives you.

Here is how I use XSLT to build links, I am showing the rowview template:

<xsl:template name="dvt_1.rowview">
<xsl:variable name="BaseURL" select="@FileDirRef"/>
<xsl:variable name="LocalURL" select="substring-before(ddwrt:UrlDirName(string($BaseURL)), '/Lists')"/>
<table border="0" cellspacing="0" width="100%" style="text-align:left;">
<td class="NavbarCell" colspan="4">
<li><a href="{$LocalURL}/Pages/home.aspx?Release={@Release}">Home</a></li>

SharePoint 2010 Workflow Create List Item Fails after Moving to New Site

Situation: You create a great workflow that auto-creates items in other lists/libraries.  Then you realize you need to move this workflow because you are moving the site to a new location or you have created this workflow in a test/dev environment and need to place it in production.
Problem: When you move a workflow, the reference to the other library/list that the workflow creates items in will break because in essence it is referring to the List GUID and this GUID does not exist in your new location.
Here is a picture showing some of the actions (my workflow creates 20+ items based on checkboxes in a list item).
As you see I have corrected the first 2 actions and left the second 2 with the old incorrect GUIDs.  After you move the workflow it will shows these GUIDs because these GUIDs refer to the list or library on the site you moved this workflow from and now it cannot bring in the proper name of the list from the location you moved it to.
If you try to edit this action and select…