Import/Clone another section

I would like to import/clone sections between views within a same dashboard.

I’ve created a dashboard where the initial view changes depending on the screen size. When I use a phone, the dashboard shows only the most important things with links to detailed views (one per room). When I use a computer with large screen, the dashboard shows all the detail views side by side. It works great, but the maintenance is difficult, because the detailed sections are duplicated on the initial view (with the screen size condition) and in the detail view.

To ease the maintenance, I would like to import the content of one section into another section. All within a single dashboard. I think that a section could have an option to load something else instead of providing its own content and the editor would be either disabled, or it would modify the linked/cloned section (with some warning about the link).

You can just copy the yaml and place it in the new view.

That is what I did, but maintenance is really annoying. Now I have to do each change twice, or copy the yaml again and again.

In that case, create a specific file with the stuff you want duplicated and use
!include your_file.yaml

See: Splitting up the configuration - Home Assistant
This works for lovelace too.

example of your normal dashboard:

title: view 1
cards:
- type: vertical-stack
  cards: !include your_file.yaml

- type: other card
- type: other card

example fo seconds dashboard

title: view 2
cards:
- type: vertical-stack
  cards: !include your_file.yaml

- type: other card
- type: other card

your_file.yam

- type: card 1
  name: blabla
  tap_action:
    action: none

- type: card 2
  name: blabla
  tap_action:
    action: none

Yes, I wish to have something like this, but in the GUI. Having the visual editor is so much better than writing the config in yaml, because I don’t know all the options and it immediately shows the preview. In the end, I would do the editing in GUI and then copy the yaml to a config file, which does not save any effort for two instances…

Because this is advanced stuff, it is impossible to create via a UI editor. If you want this, you must use yaml. There is no other way except double maintenance.

Yes, that is why I wrote the feature request :wink: