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>
	::if (SET_HOTJARID)::

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.

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

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"); ?>
1 Like