Desktop User Guides > Professional > Interview scripting > Writing interview scripts > Page layout facilities > Templates > Displaying response controls side by side with question text > Sub-templates for block and page questions
 
Sub-templates for block and page questions
A question template that is applied to a block or page can contain multiple mrData Tags (the <mrData Index="CCC"> attribute can be used). The Index attribute is supported by the mrData element in the LayoutTemplate.
Take the following metadata script as an example:
Metadata(en-US, Question, Label)
Disclosure "We do not disclose your personal details to anyone
outside our company."
info;

HowUseAnswers "The answers you give to the following questions
will be used for analysis purposes only."
info;

FirstName "What is your first name?"
text [1..20];

Job "What is your position in your company?"
categorical [1..1]
{
IntScriptwriter " Interview scriptwriter",
SMScriptwriter "Sample management scriptwriter",
SysAdmin "System administrator",
PhoneSupervisor "Phone room supervisor",
ProjMan "Project manager",
Interviewer "Interviewer",
Coder "Coder"
};

Age "How old are you?"
long [1 .. 200];

Demographics "Demographics"
page(
FirstName,
Job
);
End Metadata
The resulting Default Template.htm and Default Question Template.htm are:
<html>
<head>

</head>
<body>

<mrData Index="2" />
<mrData Index="1" />
<mrData />
<div><br/></div>
<mrNavBar />
</span>
</span>
</body>
</html>
and
<mrSubTemplate>
  <mrData Index="1"/>
  <mrData Index="2"/>
  <mrData QuestionElement='Controls'/>
  <mrData QuestionElement='Label'/>
   <div><br/></div>
<mrData QuestionElement='Error' />
<div><br/></div>
</mrSubTemplate>
The routing script is defined as:
Routing(Web)
IOM.LayoutTemplate = "Default Template.htm"
Demographics.QuestionTemplate = "Default Question Template.htm"
Demographics.Ask()

Age.Ask()
End Routing
The rendered HTML contains the QuestionElement’s Control and Label elements, and well as the Question template’s Index element.