directus-extension-super-table 0.5.0 β 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -13
- package/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ Smart image handling with an enlarged hover preview, proper aspect ratios, and a
|
|
|
37
37
|
Duplicate items with all their relationships and translations. Perfect for creating variations of complex data structures.
|
|
38
38
|
|
|
39
39
|
### π§© Many-to-Any (M2A) Display
|
|
40
|
-
Render polymorphic Many-to-Any relationships directly in the table
|
|
40
|
+
Render polymorphic Many-to-Any relationships directly in the table β built straight from the native field picker or by hand. Use `{{item:<collection>.<field>}}` for a target's fields (nested chains like `{{item:partners_catalog.catalog_id.title}}` work), `{{collection}}` for the discriminator, and bare tokens like `{{code}}` for parent-row fields. Each junction row resolves against its own target collection.
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
@@ -164,24 +164,34 @@ sidebar under **Layout Options β Column Displays**:
|
|
|
164
164
|
3. **Templates** use the `{{ field }}` mustache syntax and may reference related fields
|
|
165
165
|
|
|
166
166
|
#### Many-to-Any (M2A) templates
|
|
167
|
-
M2A fields are polymorphic β each row points at one of several target
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
- `{{item:<collection>.<field>}}` β a field on a specific target collection
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
167
|
+
M2A fields are polymorphic β each junction row points at one of several target
|
|
168
|
+
collections. Build the template straight from the **native field picker** (it now
|
|
169
|
+
resolves correctly), or write tokens by hand. Tokens resolve per junction row; on a
|
|
170
|
+
name clash the most specific (deepest) match wins:
|
|
171
|
+
|
|
172
|
+
- `{{item:<collection>.<field>}}` β a field on a specific target collection;
|
|
173
|
+
nested paths work, e.g. `{{item:partners_catalog.catalog_id.title}}` (M2A β M2O β value)
|
|
174
|
+
- `{{collection}}` β the name of the row's target collection (the discriminator)
|
|
175
|
+
- The field-key-prefixed forms the picker emits also work, e.g.
|
|
176
|
+
`{{treatment.collection}}`, `{{treatment.item:service.name}}`, or a junction
|
|
177
|
+
column like `{{treatment.sort}}`
|
|
178
|
+
- `{{<parentField>}}` β a bare token reads a field on the parent row, e.g.
|
|
179
|
+
`{{code}}` shows the order's own code next to each item
|
|
180
|
+
- **Deep paths through the target work too**, including a `translations`
|
|
181
|
+
relation stored inside the target: `{{item:service.translations.label}}`.
|
|
182
|
+
Add a `:lang` suffix to choose the language (`β¦translations.label:de-DE`);
|
|
183
|
+
without it the current user's language is used. The `:lang` suffix is
|
|
184
|
+
honored on M2A `item:` tokens only; on other relational columns it is not
|
|
185
|
+
interpreted (and an invalid path is dropped rather than sent to the API).
|
|
186
|
+
|
|
187
|
+
Each junction row only resolves the item token whose `<collection>` matches its own
|
|
177
188
|
target, so a template can cover every allowed collection at once:
|
|
178
189
|
|
|
179
190
|
```
|
|
180
191
|
{{collection}}: {{item:partners_catalog.name}} {{item:service.name}}
|
|
181
192
|
```
|
|
182
193
|
|
|
183
|
-
The editor shows the allowed collections and an example for the selected field.
|
|
184
|
-
bare token (e.g. `{{name}}`) is intentionally dropped for M2A β use the `item:` form.
|
|
194
|
+
The editor shows the allowed collections and an example for the selected field.
|
|
185
195
|
|
|
186
196
|
### Bookmarks
|
|
187
197
|
Save table configurations for quick access:
|