Please help with my menu

Hi,

I have a yaml lovelace dashboard which is a set of about 12 panels/views

views:
  - !include /config/lovelace/panels/s-home.yaml
  - !include /config/lovelace/panels/s-study.yaml 
  - !include /config/lovelace/panels/s-kitchen.yaml          
  - !include /config/lovelace/panels/s-bedroom.yaml
  - !include /config/lovelace/panels/s-sockets.yaml
  - !include /config/lovelace/panels/s-lights.yaml
  - !include /config/lovelace/panels/s-david.yaml
  - !include /config/lovelace/panels/s-batteries.yaml
  - !include /config/lovelace/panels/s-heating.yaml
  - !include /config/lovelace/panels/s-config.yaml
  - !include /config/lovelace/panels/s-entrance.yaml

each view is also an include, and begins with a menu bar (each panel uses the same menu bar include)

title: Home
theme: Github Dark Theme
badges: []
cards:
  - type: vertical-stack
    cards: 
      - type: horizontal-stack
        cards: !include /config/lovelace/tiles/s-menu.yaml
      - type: horizontal-stack
        cards: !include /config/lovelace/tiles/home.yaml
      - type: horizontal-stack
        cards: !include /config/lovelace/tiles/s-footer.yaml
panel: true

The menu buttons currently call the lovelace URL for a specific page, which gives me a way to present different panels.

What i WANT to be able to do is to change the button theme for the selected button when I press it. Remember, all pages are calling the same menu, so that I only have one place to edit it.

I would guess this would be easy enough to do by surrounding each button with a conditional based on the property of an text helper/input_text - however to change that text i’d need to run a script, and I can’t see how to run a script AND call the relevent lovelace url to load the page required. I also can’t see how to call the lovelace URL from a script to allow me to only call the script.

I’m hoping some of you lovelace gurus out there can point me in the right direction. I’ve seen some frankly unbelievable designs out there with conditional content :slight_smile:

TIA

Let’s see, if I get your question right. :slight_smile: If I understand correctly, you want to change the appearance of a button when you click on it, is that correct?

If so, I’d suggest (recommend) the use of button-card from RomRaider, you can find it here:

As you can see, there are near endless possibilities to configure anything you want. Different colors, text or whatever depending on the state (or other things), you can even embed other cards into it. To sum it up, if you have something that looks remotely like a button, button-card is your friend.

Look in the corresponding thread for some very in-depth examples, what people achieved with it, here:

And to bring that to the next level, button-card is able to work with it’s own template functionality, so you can split these configurations either internally (button-card) or externally (like you already did).

But I have to warn you, button-card is something that takes a few days to get an oversight, what you can do with it, but once you dive into it, it’s amazing. I’m currently working (together with others) on somewhat like a theme, that only uses button-card. Other cards are only used in an embedded way. :slight_smile: