Compose.yml.tpl for volume names

Hello,
I need to use secrets that are only supported in compose v2+, but i have a problem with volume name.

With v1 i can specify a volume name variable to be filled per catalog:
${name_or_path}:/container/path

And that’s very cool i can use volume name if using nfs or path if using local driver.

Unfortunately the new v2 way you have to specify the name in volumes so a thing like this:
volumes:
${name_or_path}:
external:true
Isn’t working anymore, cause i’m using a key as variable…
Is there any way to use the .tpl to avoid this problem?
Thanks.