Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question on split !include #55

Closed
ktownsend-personal opened this issue Nov 6, 2020 · 1 comment
Closed

question on split !include #55

ktownsend-personal opened this issue Nov 6, 2020 · 1 comment

Comments

@ktownsend-personal
Copy link

Does the split !include trick work for dashboards? I saw your example of it for automations, but can't seem to get it working for a yaml dashboard view to load cards from 2 places.

#from your autmoation integration yaml:
automation: !include ../automations.yaml
automation split: !include_dir_list ../automations

#what I want to do in my dashboard view, but it doesn't work:
cards: !include cards.yaml #file contains a list of includes to common cards I share between views
cards split: !include_dir_list ../cards/view1 #folder of cards for this dashboard

#alternative that I like better because 1 less file, but it doesn't work either:
cards:
  - !include ../../common/cards/test.yaml
  - !include ../../common/cards/test2.yaml
cards split:  !include_dir_list ../cards/view1

#also tried this, both with and without the hyphen on the 3rd item:
cards:
  - !include ../../common/cards/test.yaml
  - !include ../../common/cards/test2.yaml
  - !include_dir_list ../cards/view1

#This is viable, if I do a lot of individual stub files that each just !include the common cards.
#That's a lot of tiny files that feel unnecessary
cards: !include_dir_list ../cards/view1

#This is also viable, if I individually !include every card I want.
#It's not dynamic like the !include_dir_list, but it does give me better control of the card order.
cards:
  - !include ../../common/cards/test.yaml
  - !include ../../common/cards/test2.yaml
  - !include ../cards/view1/card1
  - !include ../cards/view1/card2

Related question: how do you control the card order when you use !include_dir_list? Are they alphabetical by file name?

@frenck
Copy link
Owner

frenck commented Nov 6, 2020

Nope.

@frenck frenck closed this as completed Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants