Skip to main content
1 of 2

You can wrap parameters of your channel:entries tag in simple conditionals. This will provide you with one way to prevent repeating your template code.

So instead of duplicating your channel loop (which as you said is not very DRY), just use one loop and put the category parameter inside a conditional:

{exp:channel:entries 
    {if segment_1 == ""}category="1"{/if}
}
    {!-- channel entries template stuff --}
{/exp:channel:entries}

Or if you did want to use a snippet (which would prevent you from having to repeat template code as you said) and still have the usability of working with files you can use Snippet Sync. I use it on all my installs and it works great. There is a developer license available.