Inserted full group index template, but it won't show any groups

I’m trying to make some customizations to the group index page, but haven’t gotten it to work yet, so I thought I’d try putting in the whole groups/index template and go from there.

So in the </head> of my customization dashboard, I have entered:

<script type="text/x-handlebars" data-template-name="groups/index">
(the entire index code from here)

Just entering this change removes showing any group on the group index page, and instead displays “There are no visible groups.”

So in some way just inserting the entire index code does not work. Is there something I am missing?