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
<title>@reserve("title", "Welcome to Textwire")</title>
189
+
</head>
190
+
<body>
191
+
@reserve("content", "There is nothing here")
192
+
</body>
193
+
</html>
194
+
```
195
+
178
196
### Important notes
179
197
180
-
-**Takes one argument.**`@reserve` directive accepts a single argument: the name of the reserved placeholder. This name will be used in the [`@insert`](#insert) directive to insert content into the corresponding placeholder.
181
198
-**Only in layout files.**`@reserve` can only be used inside layout file. Using it in templates and components will result in error.
182
199
-**`@insert` is optional.**`@reserve` does not force you to have a matching `@insert`. If you don't insert any value into `@reseve`, it will fallback to an empty string.
200
+
-**One `@reserve` per file.** You cannot define multiple `@reserve` directives with the same name in a single layout file. It will result in an error starting from version [v3.1.0](https://github.com/textwire/textwire/pull/68).
183
201
-**Can be passed to components.** If you want to pass the value of `@reserve` from layout into a component, you can pass it using [slots](/v3/language-elements/directives#slot). Example:
184
202
```textwire :no-line-numbers
185
203
@component('header')
@@ -285,6 +303,7 @@ In this example, both default and named slots are used within a single component
285
303
-**Duplicate names not allowed.** Defining multiple default slots or named slots with the same name in a single component will result in an error.
286
304
-**Empty string is default slot.** If you provide an empty string as a slot name, it will act as default slot. `@slot` and `@slot('')` act the same.
287
305
-**Slots have current context.** Slots have the context of the same file where they are defined. It means you can dinamically modify the content of a slot before it get rendered in the component file.
306
+
-**Optional.** External slots that live inside the component file are optional. If you don't provide content for a slot, it will be rendered as an empty string.
0 commit comments