How to display dynamic HTML Web Content in K2 SmartForms
With the K2 Workflow process, we have found that a large percentage of clients at some point request to have a visual representation of the Workflow within their application. By using a combination of K2 SmartForm features we can accomplish this.
The main focus of this topic is the K2 SmartForms Content Control. This control allows you to specify a URL and display the web content of the specified URL within your own page.
Once you have added the Content control to your view, you can either specify a static URL / placeholder URL, show a preview (only if you provided a static URL) and change the scrolling settings.
For this example we need to display a dynamic URL based on the K2 ID for each specific workflow. To do this we use a combination of K2 SmartForm rules and expressions. We set the dynamic URL on view initialise to demonstrate this.
When you configure the rule we just added you will see that you have access to all the view parameters, K2 SmartObjects, view controls as well as existing expressions. The dynamic URL used here comes from an expression we created that concatenates the K2 Workflow URL with the K2 ID in order to display a specific workflow based on parameters sent through upon view initialisation.
For more information on using K2 expressions view some of our previous blogs on the topic:
Or, if you need a different approach have a look at:
HTML Web Content in K2 SmartForms