Need help splitting lovelace files

Im trying to split my lovelace file but I dont get it.

I have a problem. I think its much more difficult to edit this yaml files than using RAW editor in Lovelace.

I have a code in the raw editor that works just fine, but just copy and paste dont work!

For example, Im trying to make a 3x3 columns and rows. But it dont work now in yaml mode, look at my code below:

File: 00-menu.yaml (in /ui-lovelace/)

title: Menu
panel: false
badges: []
id: menu

# MENU


cards:
  - cards:
      - entity: switch.lyxlage
        icon: 'mdi:lightbulb-on-outline'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;

          }    
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/1
        type: 'custom:button-card'
      - entity: switch.lyxlage
        icon: 'mdi:security'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;
          }           
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/2
        type: 'custom:button-card'
      - entity: switch.lyxlage
        icon: 'mdi:weather-partly-cloudy'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;
          }                      
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/3
        type: 'custom:button-card'
    type: horizontal-stack
  - cards:
      - entity: switch.lyxlage
        icon: 'mdi:lightbulb-on-outline'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;

          }    
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/1
        type: 'custom:button-card'
      - entity: switch.lyxlage
        icon: 'mdi:lightbulb-on-outline'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;

          }    
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/1
        type: 'custom:button-card'
      - entity: switch.lyxlage
        icon: 'mdi:lightbulb-on-outline'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;

          }    
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/1
        type: 'custom:button-card'
    type: horizontal-stack
  - cards:
      - entity: switch.lyxlage
        icon: 'mdi:lightbulb-on-outline'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;

          }    
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/1
        type: 'custom:button-card'
    type: vertical-stack
type: vertical-stack


    
 

This is what I get:

Why is my last button on the right, and not below the others!? I have tried 100 different settings and its impossible.

Also, when using “panel: true” I get this, where are my other buttons!?? :sweat_smile::rofl::joy:: ??

And my ui-lovelace.yaml looks like this:

background: center / cover no-repeat url("/local/images/bg/bg2.jpg")
cch:
  swipe: true
  swipe_animate: swipe
  voice: hide
resources:
  - resources: null
  - type: module
    url: /local/mini-media-player-bundle.js?v=1.4.2
  - type: module
    url: /community_plugin/mini-graph-card/mini-graph-card-bundle.js
  - type: js
    url: /local/monster-card.js?v=2
  - type: module
    url: /community_plugin/button-card/button-card.js
  - type: module
    url: /community_plugin/decluttering-card/decluttering-card.js
  - type: module
    url: /community_plugin/lovelace-card-mod/card-mod.js
  - type: module
    url: >-
      https://cdn.jsdelivr.net/gh/bramkragten/weather-card/dist/weather-card.min.js
  - type: module
    url: /community_plugin/atomic_calendar/atomic_calendar.js
  - type: js
    url: /community_plugin/lovelace-grocy-chores-card/grocy-chores-card.js
  - type: module
    url: /community_plugin/bignumber-card/bignumber-card.js
  - type: js
    url: /community_plugin/vertical-stack-in-card/vertical-stack-in-card.js
  - type: js
    url: /community_plugin/lovelace-home-feed-card/lovelace-home-feed-card.js
  - type: js
    url: /customcards/github/thomasloven/card-tools.js?track=true
  - type: js
    url: /customcards/github/thomasloven/layout-card.js?track=true
  - type: module
    url: /community_plugin/compact-custom-header/compact-custom-header.js
  - type: module
    url: /community_plugin/garbage-collection-card/garbage-collection-card.js
  - type: module
    url: /local/timer-card.js
  - type: module
    url: /community_plugin/banner-card/banner-card.js
  - type: js
    url: /community_plugin/lovelace-home-feed-card/lovelace-home-feed-card.js
  - type: js
    url: /local/list-card.js?v=0
title: Home
views: 
    - !include /config/ui-lovelace/00-menu.yaml
    - !include /config/ui-lovelace/01-home.yaml
    - !include /config/ui-lovelace/02-lights.yaml
 

Please someone help me!! :joy::joy:

In looking at your code, you have defined 3 cards, starting at lines 10, 67 and 126. The first two cards have 3 entities each. The third card has one entity. The ‘type: vertical-stack’ on line 147 is not used in the correct way. Look at the Lovelace Vertical Stack examples to see correct usage.

To answer your question, the code with Panel:False displays exactly the way you defined it with the exception of the aforementioned Vertical Stack error. There are two cards in the left column and one card in the right column. This is a default layout flow with no ‘stacks’ defined. In Panel:True, ONLY the first card is displayed in FULL WIDTH, hence only 3 entities will display as it is currently coded. Fixing the Vertical Stack issue will result in the layout being more like what you were trying to do.

You will need to get a better understanding of using vertical and horizontal stack before you can get your card layout as you want. Its not terribly hard once you understand the logic, and it is way easier with simple examples and limited entities. Once you get the structure worked out you can add entities and tweak for final looks.

There are tons of examples on GitHub that you can learn from. Mine is here: https://github.com/kartcon/Home-Assistant-Public
Feel free to examine all my lovelace cards. They are located in the Lovelace folder. Many use a combination of vertical and horizontal stacks as well as Panel: true and Panel: false.

Ok, after a little bit more testing without to much entities I found out that this is how it should look:

cards:
  - cards:
      - cards:
          - entity: switch.lyxlage
            type: 'custom:button-card'
          - entity: switch.lyxlage
            type: 'custom:button-card'
          - entity: switch.lyxlage
            type: 'custom:button-card'
        type: horizontal-stack
      - cards:
          - entity: switch.lyxlage
            type: 'custom:button-card'
          - entity: switch.lyxlage
            type: 'custom:button-card'
          - entity: switch.lyxlage
            type: 'custom:button-card'
        type: horizontal-stack
      - cards:
          - entity: switch.lyxlage
            type: 'custom:button-card'
          - entity: switch.lyxlage
            type: 'custom:button-card'
          - entity: switch.lyxlage
            type: 'custom:button-card'
        type: horizontal-stack
    type: vertical-stack

But I dont really understand the point with my first card?