You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/syntax/applies-switch.md
+35-7Lines changed: 35 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,31 +79,59 @@ Content for Serverless
79
79
80
80
## Automatic grouping
81
81
82
-
Applies switches are automatically grouped together by default. This means all applies switches on a page will sync with each other - when you select a version in one switch, all other switches will automatically switch to the same version.
82
+
All applies switches on a page automatically sync together. When you select an applies_to definition in one switch, all other switches will switch to the same applies_to definition.
83
83
84
-
Items with the same applies_to definition will sync together across all switches on the page. For example, if you have `stack: preview 9.1` in multiple switches, selecting it in one will select it in all others.
84
+
The format of the applies_to definition doesn't matter - `stack: preview 9.1`, `{ "stack": "preview 9.1" }`, and `{ stack: "preview 9.1" }` all identify the same content and will sync together.
85
85
86
-
In the following example we have two applies switch sets that are automatically grouped together.
87
-
Hence, both switch sets will be in sync.
86
+
In the following example, both switch sets are automatically grouped and will stay in sync.
87
+
88
+
::::::{tab-set}
89
+
:::::{tab-item} Output
88
90
89
91
::::{applies-switch}
90
-
:::{applies-item} stack: ga 9.0
92
+
:::{applies-item} { "stack": "preview 9.0" }
93
+
Content for 9.0 version
94
+
:::
95
+
:::{applies-item} { "stack": "ga 9.1" }
96
+
Content for 9.1 version
97
+
:::
98
+
::::
99
+
100
+
::::{applies-switch}
101
+
:::{applies-item} stack: preview 9.0
91
102
Other content for 9.0 version
92
103
:::
93
104
:::{applies-item} stack: ga 9.1
94
105
Other content for 9.1 version
95
106
:::
96
107
::::
97
108
109
+
:::::
110
+
:::::{tab-item} Markdown
111
+
112
+
```markdown
113
+
::::{applies-switch}
114
+
:::{applies-item} { "ece": "ga 3.0" }
115
+
Other content for ECE 3.0 version
116
+
:::
117
+
:::{applies-item} { "ece": "ga 4.0" }
118
+
Other content for ECE 4.0 version
119
+
:::
120
+
::::
121
+
98
122
::::{applies-switch}
99
-
:::{applies-item} stack: ga 9.0
123
+
:::{applies-item} ece: ga 3.0
100
124
Other content for 9.0 version
101
125
:::
102
-
:::{applies-item} stack: ga 9.1
126
+
:::{applies-item} ece: ga 3.1
103
127
Other content for 9.1 version
104
128
:::
105
129
::::
106
130
131
+
```
132
+
:::::
133
+
::::::
134
+
107
135
## Supported `applies_to` definitions
108
136
109
137
The `applies-item` directive accepts any valid applies_to definition that would work with the `{applies_to}` role.
0 commit comments