Archive for the 'SharePoint Customization' Category


Referencing a Custom Help Page with the Help.aspx page in SharePoint 2013

I was trying to find an easy way to navigate directly to a custom SharePoint help page and figured there must be some URL parameters I could use to get there.  However, all my searching only turned up snippets of JavaScript such as this one…which is okay, but I really wanted to understand what /_layouts/15/help.aspx page was really wanting.

var navBarHelpOverrideKey = “[Help Collection Product]_[Context Key]”;

If you look at the link provided by clicking on the help icon, you may see some links like these, once you navigate to the exact topic you want to view.

Notice here you see AssetKey=.  This appears to expect some semi-colon delimited GUID on the parameter value.  I’ve found that using Key= is what you probably want to use. Collection Help/CustomHelp/LogonScreen/CustomTopic.htm;41fdd883-01d2-4c2a-9a25-4465d705c17a;

What I wanted to do was provide the exact topic in some sort of URL parameter.  What I found is you can use this format.  It is essentially the name of your folders you created in your custom help and the help page’s context key separated by underscores, e.g. Key=MyCustomHelpCollection_MyCustomHelpCategory_1.  The missing piece here is the Context Key added on the end.  This takes you directly to the page, without having to navigate through the Collection and Category.  Note that the URL parameter name you might be tempted to use is AssetKey=, while the correct URL parameter name to use for this type of navigation is simply Key=.

image Collection Folder Name]_[Help Category Folder Name]_[Help Page Context Key]

What does this mean?  This means that after you create a custom help library by enabling the feature and creating some content, as discussed in these articles, you can link directly to your topics if you need to.

Create a Custom Help Library to SharePoint 2013

Create a Custom Help Library for SharePoint Foundation 2010

It’s really possible this information exists somewhere out there, but I sure couldn’t find it after a couple hours of searching.


403 Forbidden Error on Custom FBA Login Page

We wrote a custom FBA login page and had it working in our QA system and were in the process of setting it up in our production system when we encountered a "403 Forbidden" error.  The page was written as a modification to the FBA pack on CodePlex and thus was located in the /15/template/layouts/FBA/OurCustomFolder directory.  After struggling with this for quite some time we finally realized we had set anonymous access on the site permissions in QA to "lists and libraries" (for another reason) and had not made that same change to production.


Making this change fixed our "forbidden" error. 

Interestingly, when using the out-of-the-box FBA login page, there was no issue.


Reordering and Hiding Fields and Passing URL Parameters on a New Item Form in SharePoint 2010

Let’s say you are creating a new item form using SPD 2010 and you don’t have InfoPath because the company didn’t purchase the Enterprise version of SharePoint.  Your goal is to pass a URL parameter to the new item form from some other part of the SharePoint application you are building.  Perhaps the link that contains the URL parameter was created by a workflow (hint hint).


You insert the custom list form like this.


The goal is to move this field down to the end of the form to get it out of the way.


You select the row and cut it for repositioning to the end of the form.


Now you’ve got it at the bottom of your form.


Now you test your form (before adding the parameter to pass) and it "works" but it doesn’t correctly save the data in the field you relocated.

The correct way to do this is to delete the field row at the top, add a new row at the bottom and insert a new text field and bind it to the column.


Bind the Data field to the column and format it as a Text Box.


Under Options, select Parameters and add a New Parameter, giving it a name that is memorable for you.  Then, bind it to the Query String variable of your choice.


With your text box selected, find the text property and change it from @Fieldname to $Parametername.


If you don’t get the name correct, you’ll see an error displayed instead of your form.


If you want to hide the field completely on the form to eliminate any human intervention, add class=ms-hidden to the table row.



Conditional Formatting and date comparisons with SharePoint Designer 2010

So here’s a fun one that we at SharePoint Rx were struggling with the other day. 

We were creating a dashboard using the DVWP in SharePoint Designer 2010 and had to perform some date comparisons to control the display of indicators.  If you’ve used SPD in the past, you know that the goal is to NOT write code, but to use the “coding by clicking” capabilities of SPD and allow it to write the code (in this case XSL) to control your conditional formatting.  Every time I use SPD for something like this, I always seem to run into a new problem, even though I know it should be a simple task. 

“Am I the only one with this issue?” he asks.

Here’s the end goal…to display a status indicator for tasks to indicate whether they were completed on time, completed late, not complete and not late, and not complete and late.  You can see the four icons I chose to indicate these statuses. 


My “conditions” are as follows:

clip_image001 Status equals “completed” and Due Date >= Completed Date

clip_image002 Status equals “completed” and Due Date < Completed Date

clip_image003 Status not equals “completed” and Due Date >= [Current Date]

clip_image004 Status not equals “completed” and Due Date < [Current Date]

One of the issues you immediately experience is the comparison of date values.  Using SPD, I did an “un-advanced” comparison in my condition statements and never got the correct results.  SPD wrote some XSL like this (I broke it up so it’s a little easier to read):

<xsl:if test=”normalize-space($thisNode/@Status) = ‘Completed’


ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@DueDate))) &gt;=
normalize-space(@Completed_x0020_Date)” ddwrt:cf_explicit=”1″>

<img src=”_layouts/images/kpinormal-0.gif” width=”16″ height=”16″ />


So we have a “Due Date” that has been operated on by ddwrt:DateTimeTick (see if you can find any documentation on this function) and is returning the number of days from January 1, 1900 comparing to the “Completed Date” in the form “MM/DD/YYYY.”  That doesn’t work!

Sidebar rant…Come on, Microsoft!  The only documentation on the ddwrt namespace is from a non-MS person (Serge van den Oever ) and is from 2005…for SharePoint 2003?

So, let’s look at the “Advanced” condition criteria that does work.


We used the completely undocumented ddwrt:DateTimeTick function and applied it equally to both dates.


When performing the comparison with [Current Date], here’s what we did.


We were successful with using the $Today variable, but I’ve seen others who have also used ddwrt:Today.


Here are the criteria for all four conditions.

@Status = ‘Completed’ and ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(@DueDate))) >= ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(@Completed_x0020_Date)))

@Status = ‘Completed’ and ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(@DueDate))) < ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(@Completed_x0020_Date)))

$thisNode/@Status != ‘Completed’ and ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@DueDate))) >= ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($Today)))

$thisNode/@Status != ‘Completed’ and ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@DueDate))) < ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($Today)))

Now, I’d like to believe that features in SPD 2010 that were in SPD 2007 were all functioning correctly, but I seem to have lots of problems using the “All formatting visible” functionality.  I found that each time I changed this I must

  • Save the page
  • Press F5 to refresh (sometimes more than once)

Not sure what that’s about or if it’s just one of my settings, but it sure is annoying.


Of course, the idea is that you want to make all your conditionally formatted elements visible so you can easily work on them.


FYI, if you want to determine which condition applies to which element, you can select the condition and you should notice a highlighting of the element to which the condition corresponds. 



Conditional formatting

SharePoint Designer 2010

Date comparison

Data view web part

ddwrt namespace


Let’s Make a Clickable Image Map Using SharePoint Designer 2010

…and I do mean Map!

Get your base image and copy it to the clipboard.  I’m going to use a map of the world.


On the asset-based navigation in SPD 2010, you’ll need to navigate to an object that will allow you to create an HTML file in it.  Here I’m using Site Pages, but you could also select All Files.  You probably want to save it somewhere so you can modify it later, if need be.


Open the file (Untitled_1.html) for editing.


Delete the HTML that came with the new page.


Paste your image into the page.


Click on the map image and then select Format under Picture Tools.  You’ll now have access to the Hotspot tool.  Select either the Polygonal, Rectangular or Circular Hotspot drawing tool.


Using your coloring skills you learned in Kindergarten, trace each of the areas you want to hotspot.


When you close the polygon, you’ll get a dialog where you can enter the address that the hotspot is linked to.


Copy all the source to the clipboard…


…and paste it into the HTML view of a content editor web part.


You should see it displayed with the regions visible.


The finished product.  Hovering over an area will give you "the hand" and clicking will take you to your hyperlink.



Running the Content Query Web Part (CQWP) on a Team Site Without the Publishing Infrastructure Feature Enabled in SharePoint 2010

I was doing a little monkeying around (read that "book editing") with SharePoint 2010 and decided to see if the similar post I read by Sameer Dhoot was still true in 2010.  If you are missing the CQWP in SharePoint, you’ll find that activating the Publishing Infrastructure feature will fix the problem, as the CQWP is added/enabled as part of the Publishing Infrastructure.  Well, what if you want to use it in a team site for some reason?  Turns out you can still do it.

If you simply export the CQWP from the web part gallery of your publishing site and import it to the web part gallery on your collaboration site, you won’t run into any problems.


You can export the web part by clicking the Edit icon and selecting the Export function in the ribbon.


The problems will start to occur when you try and use it.  You’ll get errors when your page on which you’ve added the CQWP attempts to render the web part.


In this version of SharePoint, there is a Style Library in both collaboration and publishing sites.  The important difference is that the collaboration site Style Library is empty.  This is where the problem resides.  You can either copy the content out of the publishing site style library or, you can create a list template out of the publishing style library and save the content with the template. 

Since the publishing site does not have a "Save document library as template" link, you’ll have to create one on your own.  Navigate to the library settings on your Shared Documents library and select the "Save document library as template" link.  You’ll notice that this is using the _layouts/savetmpl.aspx page and it is passing the List GUID as a parameter  (/_layouts/savetmpl.aspx?List=%7B1C534D30%2D9F2F%2D41A5%2DAC98%2D51CD244F532D%7D).


Navigate to the publishing site’s Style Library settings page (_layouts/listedit.aspx).  Now simply change the listedit.aspx to savetmpl.aspx and press enter.  Fill out the form being sure to "Include Content" and save it.


You should get a successful save.  Now navigate to the list template gallery.


Right-click and save the list template (STP) on your computer. 


Now all you need do is navigate to your site template gallery on your collaboration site and upload the STP file.  Then you can delete the existing Style Library and create a new list called Style Library from the template. 


You should now feel the love the the CQWP in your collaboration site.


Further investigation shows that the CQWP needs these three style sheets in order to function correctly:  ContentQueryMain, Header and ItemStyle.  Removing any of these from the Style Library will cause the CQWP to throw an error.  So, you could probably just export these styles and import them into your collaboration site’s Style Library and accomplish the same thing.



Render Failed on SharePoint List Views

Today I helped a client solve one of the many mysteries around the infamous "Render Failed" that so many people seem to get at some point in time on MOSS 2007.  In this situation, the error started appearing on several list views and nothing had been changed for several weeks prior.

After some trial and error, I found the problem was tied to several site columns that were being displayed in the views.  The site columns were lookup columns and were used many places throughout the site hierarchy.  Of course, this happened on the same day that my son and daughter-in-law were having their first child (and our first grandchild), so I found myself troubleshooting from the waiting room at Medical City in Dallas.  I know this doesn’t have anything to do with the problem, but my son’s a new father and I’m a new grandfather…so sue me!  I’ve got a captive audience and I’m a proud grandpa.  🙂


Cason Noble Wright 2010-05-19

Anyway, it was really weird that nothing had been changed and this started and was fairly widespread.  After monkeying with filters, view styles, sorting, grouping to see if any of those things changed the outcome, I observed that, as I removed columns from the display, the views began to work.  That’s how I determined that the problem was tied to the site columns that were of the type "lookup."

To make things worse, later during the day the SharePoint site completely quit.  Now I suspected something was amiss on one of the servers.

This client has a simple two-server setup, so I VPN’d in to each server.  When I got on the SQL Server, I found that AUTOMATIC UPDATES was on and the machine had been updated and was awaiting a reboot.  Ah ha!  Finally a potential root cause. 

I quickly contacted the client and told them to reboot the SQL Server and the problem was solved.  And, TURN OFF AUTOMATIC UPDATES ON A PRODUCTION MACHINE!!!

Now, back to the grandbaby…

Reference Links:

Render Failed on a List View


SharePoint Issues


Asif Rehmani’s SharePoint Videos


Click to access a wealth of SharePoint videos

SharePoint Rx

SharePoint Rx Home


Posts by Date

June 2020
Support Wikipedia