Template embedding

Embedding templates means that they are loaded and processed on the server and the result is then included in the calling template.

Example: static module template in folder mod/admin with name index.xml
<module>

    <onload><![CDATA[
   ... content ...
   ]]></onload>

   <body><![CDATA[
   ... content ...
   ]]></body>

</module>

Usage in another template (page or module):
// load template
{mpf:xml={mpf:server/root-local}mod/admin/index.xml||importas=text||tag=mymod}
// use template
<html>
<head>
<script type="text/javascript">
window.onload=function(){
{mpf:mymod/onload||parse=yes}
};
</script>
</head>
<body>
{mpf:mymod/body||parse=yes}
</body>
</html>

Template linking

Linking of static module:
<a href="?lang=de&id=20&type=page&mod=admin&tab=index">Load template</a>
The parameters lang, id, type, mod and tab are all optional if default values apply.

Linking of Ajax module:
<a onclick="xGet('?lang=de&id=20&mod=admin&tab=edit');">Load template</a>
A value for parameter mod is required. The other parameters are optional if default values apply.
// container where Ajax-Request may put its content
<div id="myTarget"></div>
// example of script-Tag in called template
<script>

var sb=[];

sb[sb.length]='hello world';

$('myTarget').innerHTML=sb.join('');

</script>