Template shims and attachment handlers