Favicon within K2 SmartForms

Markus Kolbeck
Markus' Blog
Published in
1 min readOct 1, 2015

This is a a great way to individualize your solutions using favicon within K2 SmartForms even more.

There is no implementation by default to use favicons withing K2 SmartForms, i.e. it is not included in any aspx page by default.

Introduction

Rather than modifying the K2 aspx files, this approach adds a JavaScipt to the K2 SmartForms View or Form.
This script then loads th favicon file, which must be copied to the desired location on the K2 SmartForms runtime server in this example.

I will use the environment variable “SmartForms Runtime”, which targets to
http://k2workspaceURL.yourdomain.com/Runtime/Runtime
and the file path:
C:\Program Files (x86)\K2 blackpearl\K2 smartforms Runtime\Runtime

Thanks to Arno van Rooyen who published this post:

How to call jQuery or JavaScript code in a K2 SmartForm

Code Sample

I was able to implement this functionality along with this JavaScript code:

Steps

  1. copy your favicon.ico file to the file system on the K2 SmartForms Runtime Server into C:\Program Files (x86)\K2 blackpearl\K2 smartforms Runtime
  2. add a data label to either a K2 SmartForms View or Form (and set it to hidden)
  3. add the JavaScript to the data label as an expression (described in Arno’s post. BTW you do not need the button)

Remember to replace ‘<SmartForms Runtime (default)>’ with the environment variable which can be found in the expression editor.

--

--