Templates as subtemplates

Is there any way of embedding the output of one OpenFL template (defined in the project.xml) into another template? For example:

	<template path="include/hotjar.html"  />
	<template path="assets/index.html" rename="index.php"  />

Then within index.html:

<html><title>Using subtemplates</title>
<body>
	::if (SET_HOTJARID)::
		::RESULT_OF_HOTJARHTML_TEMPLATE::
	::end::
</body>
</html>

That would be a good feature but I’m afraid it’s not possible that way.
But I think you can use a define to control the output of your main template, so all your subtemplates must be in the main template.

::if (SET_HOTJARID)::
<p>hotjarid content<:p>
::else if(SET_OTHERSUB)::
<p>other content</p>
::end::

Thanks Ludovic! I was afraid that might be the answer. I am currently using defines to control the template and fortunately, since the template ends up as PHP, I am currently getting by with this:

	::if (SET_HOTJARID)::
	<?php include_once("include/hotjar.html"); ?>
	::end::
1 Like