I got this template:
{?doesExtend}
{>base_template/}
{<param}
<div id='abc'>{foo}</div>
<div id='def'>{bar}</div>
<div id='ghi'>{bas}</div>
{/param}
{:else}
<div id='abc'>{foo}</div>
<div id='def'>{bar}</div>
<div id='ghi'>{bas}</div>
{/doesExtend}
This works but it's not DRY...I have to put the HTML in twice. How can I make it so that if doesExtend exists, then it will extend the template to a base template, and if it doesn't exist, then it will simply not extend it and render it as is, in a way that is DRY?
I would just move the repeated code into a separate partial.
Then your original template would look like: