Capture template from file but only for new entries

This post might help you structure the variable correctly.

You don’t use :if-new and :target at the same time. They do the same thing. :if-new is old and not to be used any more; :target replaces it. I believe the former remains only for backward compatibility.