The $Header command has two use cases: specify the form contains something other than HTML, and allow the form to be loaded in an iFrame.
When you include a form into another form, and the form contains pure CSS, JS, or JSON, you must add the $header variable to the top of the form. This tells the form into which it's included that it has a specific type of content. When including an iService form in an iFrame on another website, we need to tell the browser that it's ok to load our content on their website. These two use cases are explained below.
Specifying the content type
Example:
You have CSS that is used in multiple forms, so you place it into its own form (e.g., Form 2) and reference it in the other forms using the HTML "Link" parameter. You will need to add the $Header command to Form 2 and specify that it is a CSS file.
Inside of Form 1, you would use the link command below to incorporate the CSS from Form 2.
<link rel="stylesheet" type="text/css" href="/f/2"> {this brings the CSS from Form 2 into Form 1}
Inside of Form 2, you would add the following to the beginning of the form.
$Header -filetype(CSS)$
Available Parameters for $Header - filetype
Parameter Name: -filetype (required parameter)
The -filetype parameter is required to indicate the type of file that is being referenced. The options are CSS (Cascading Style Sheet), JS (JavaScript), and JSON.
Example syntax:
$Header -filetype(CSS)$ -- this indicates the form is CSS
$Header -filetype(JS)$ -- this indicates the form is JavaScript
$Header -filetype(Json)$ -- this indicates the form is Json
|
Putting forms into iFrames
Example:
You have a contact us form in iService and want to load it using an iFrame on your website.
Inside your iService form, you would use the $header variable as shown below.
$Header -allowframeall$
It's best practice to include this within a comment to avoid any unintended display in the HTML.
<!-- $header -allowframeall$ -->
Restricting your form to a specific website
You can prevent your iService form from being loaded in an iFrame from a different domain than iService by using the following version of the header variable. For example, if your iService domain is tenant.iServiceCRM.com, then you can only insert the form into other pages at tenant.iServiceCRM.com when this tag is added.
Example:
<!-- $header -allowframesame$ -->
|