In Freemarker, how can I create a template that inherits from a template that itself inherits?
Single inheritance works fine with the <#nested> tag:
File base.ftl:
<#macro layout>
<html lang="en">
<head>...</head>
<body>
<div>... (navigation bar)</div>
<div class="container">
<#nested>
</div>
</body>
</html>
</#macro>
File normalBase.ftl:
<#import "base.ftl" as base>
<@base.layout>
<div class="row">
<div class="col-md-9">
${content.body}
</div>
<div class="col-md-3">
<p>Latest releases</p>
<ul>....</ul>
</div>
</div>
</@base.layout>
How do I turn this into double inheritance where useCaseBase.ftl extends normalBase.ftl which extends base.ftl?
This works like a charm:
File
base.ftl:File
normalBase.ftl:File
useCaseBase.ftl:Now I can create
*.adocpages withjbake-typeset to eitherbase,normalBaseoruseCaseBaseand it works.