The way I’ve been using ditto is to create a chunk for a template and then if I need to include code use a snippet in the chunk. I find this can be rather cumbersome as I’m left with several different chunks and snippets to do simple calculations. Such as if I need a chunk to consider whether a template variable is active then I’d have to create a new snippet for that.
I’m wondering if there is a way to bypass the chunks for ditto templating and just create one snippet.
For example:
Chunk Template:
<h4>[+title+]</h4>
<div class="description">[+content+]<br />[[snippetcall]]</div>
Snippet Call:
<?php
if(something)
return '<a href="#" class="underline">Learn more</a>';
else
return '';
Its just a few lines of code in each and it creates the need to do a lot of clicking, loading, saving. It can create long trees of chunk->snippet that need to be tracked down for a small change. Itd be much easier for me to just put it all in one place.