Lovelace-generated and apexcharts

Hi,

All my dashboards are YAML based and HA is o the latest version. Here is how they are referred in configuration.yaml:

lovelace:
  mode: yaml
  dashboards:
  lovelace-generated: # Needs to contain a hyphen (-)
    mode: yaml
    filename: mlc_iphone.yaml
    title: MLC-iPhone
    icon: mdi:home
    show_in_sidebar: true
    require_admin: false

I use the apexcharts-card (v2.0.2) in various popup cards making use of:

action: fire-dom-event
browser_mod:
  service: browser_mod.popup

I would like to streamline the code of graphs by using templates. So far I have not manage to do it. Where do I have to store them? I do I define them? Using ui-lovelace.yaml does not seem to be working.

An ideas?
Many thanks

Just found the way…
Insert the template in my main YAML file (mlc_iphone.yaml), before the views:.