From c98a59f8cf067d2b73f443e74951f94b8f324758 Mon Sep 17 00:00:00 2001 From: Marius <33354141+Mariusthvdb@users.noreply.github.com> Date: Thu, 17 Nov 2022 15:05:50 +0100 Subject: [PATCH] some tweaks for Subview (#24976) Co-authored-by: Franck Nijhof --- source/dashboards/views.markdown | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/source/dashboards/views.markdown b/source/dashboards/views.markdown index 714eda6a42f..0b532d08dec 100644 --- a/source/dashboards/views.markdown +++ b/source/dashboards/views.markdown @@ -127,9 +127,9 @@ frontend: ## Subview -View can be marked as "Subview". Subviews won’t show up in the navigation bar on top of the sidebar. Subviews can, for instance, be used to show detailed information; you could link to this subview from a page with a clean look with only basic information (by using [cards that support the `navigate` action](/dashboards/actions)). Think of a view with a few thermostats and a subview with status information on the heating/cooling device. +A "View" can be marked as "Subview". Subviews won’t show up in the navigation bar on top of the sidebar. Subviews can, for instance, be used to show detailed information; you could link to this subview from a page with a clean look with only basic information (by using [cards that support the `navigate` action](/dashboards/actions)). Think of a view with a few thermostats and a subview with status information on the heating/cooling device. -When on the subview, the navigation bar only show the name of the subview and a back button. +When on the subview, the navigation bar only shows the name of the subview and a back button (no icon is shown). By default, clicking on back button will navigate to the previous view but a custom back path (`back_path`) can be set. You can access subviews from other parts of your dashboard by using [cards that support the `navigate` action](/dashboards/actions). @@ -176,20 +176,20 @@ views: type: list path: required: false - description: Paths are used in the URL, more info below. + description: Paths are used in the URL. type: string default: view index icon: required: false - description: Icon-name from Material Design Icons. You can use any icon from [MaterialDesignIcons.com](https://materialdesignicons.com). Prefix the icon name with `mdi:`, ie `mdi:home`. + description: Icon-name from Material Design Icons. You can use any icon from [MaterialDesignIcons.com](https://materialdesignicons.com). Prefix the icon name with `mdi:`, ie `mdi:home`. Only for "View", not for "Subview". type: string background: required: false - description: Style the background using CSS, more info below. + description: Style the background using CSS. type: string theme: required: false - description: Themes view and cards, more info below. + description: Themes view and cards. type: string visible: required: false @@ -198,12 +198,12 @@ views: default: true subview: required: false - description: Mark the view as "Subview", more info below. + description: Mark the view as "Subview". type: boolean default: false back_path: required: false - description: Only for subview. Path to navigate when clicking on back button, more info below. + description: Only for subview. Path to navigate when clicking on back button. type: string {% endconfiguration %} @@ -221,3 +221,17 @@ View configuration: - entity: switch.decorative_lights image: /local/lights.png ``` + +Subview configuration: + +```yaml +title: "Energieprijzen" +path: "energieprijzen" +subview: true +back_path: "/ui-data/climate" + +cards: + - type: entities + entities: + - sensor.today_avg_price +```