OPEN TO WORK

Available for new opportunities! Let's build something amazing together.

Watch out when you move display templates from Office 365 to On-premises

Display Templates JavaScript Search
post

This post is over a year old, some of this information may be out of date.

Today I was creating my session for SharePoint Saturday Belgium and Paris. For my demo’s I prepared a couple of display templates that were created on Office 365 / SharePoint Online. To be sure that I had a backup plan, I moved all these display templates to my development environment on-premises.

The first thing I got after I configured the web parts were errors like this:

Show image $urlHtmlEncodeString is not defined
$urlHtmlEncodeString is not defined

As it turns out, the $urlHtmlEncodeString function does only exist for SharePoint Online at the moment.

Available on Office 365: $ urlHtmlEncode, $urlHtmlEncodeString, $urlHtmlEncodeValueObject

Available on On-premises: $urlHtmlEncode

It could be that there are other functions which you cannot use on-premises. Feel free to provide me feedback if you experienced something similar.

Related articles

Report issues or make changes on GitHub

Found a typo or issue in this article? Visit the GitHub repository to make changes or submit a bug report.

Comments

Elio Struyf

Solutions Architect & Developer Expert

Loading...

Let's build together

Manage content in VS Code

Present from VS Code