Desktop User Guides > Professional > Interview scripting > Writing interview scripts > Page layout facilities > Templates > Displaying response controls side by side with question text > Custom controls > Using a custom control
 
Using a custom control
To use a custom control, define the question in the usual way and then add the templates parameter to name the sub-template that contains the control. For example:
AttendDate "When did you visit the exhibition?" templates(Question="calendar.htm") date;
Custom controls in grid and loop questions
Custom controls are appropriately rendered when used within a grid or loop. The HTMLOption ApplySubTemplatesInGrids is used to enable or disable the effects of custom controls in sub-templates for grid and loop questions.
Using the following metadata script as an example:
HDATA -
[
HtmlOptions = "ApplySubTemplatesInGrids"
];

dtelp1 "Loop_Text_Goes_Here" loop
{
red "red",
blue "blue",
green "green"
} fields -
(
AttendDate1 "When did you visit the exhibition?"
templates(
Question = "calendar.htm"
)
date;

) expand;
UNICOM Intelligence will render the results as:
This graphic is described in the surrounding text.
For <mrData QuestionElement="Parameter" Type="PType"/>, the returned result is:
PType
Result
FullQuestionName
_Qdtelp1_Qred_QAttendDate1
QuestionName
AttendDate1
See also
Custom controls