Skip to content

Commit 5fc9501

Browse files
authored
Add attribute table to ChunkCollection [skip ci]
1 parent 4751abf commit 5fc9501

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,31 @@ import { ChunkCollection, ChunkFieldValue } from "editmode-react";
7575
function Example() {
7676
return (
7777
<section className="meet_the_team">
78-
<ChunkCollection identifier="lst_123" className="team_member">
79-
<h2><ChunkFieldValue identifier="prop_001" className="name"/><h2>
80-
<h5><ChunkFieldValue identifier="prop_002" className="title"/></h5>
81-
<div><ChunkFieldValue identifier="prop_003" className="headshot"/></div>
78+
<ChunkCollection identifier="col_123..." className="team_member_container" itemClass="team_member">
79+
<h2><ChunkFieldValue identifier="fld_001..." className="name"/><h2>
80+
<h5><ChunkFieldValue identifier="fld_002..." className="title"/></h5>
81+
<div><ChunkFieldValue identifier="fld_003..." className="headshot"/></div>
8282
</ChunkCollection>
8383
</section>
8484
);
8585
}
8686
```
8787

8888
This will render editable headings containing the name and title and an image containing the headshot for every person in the "Team Member" collection.
89+
#### ChunkCollection Attributes
90+
|Attribute|Type|Description|
91+
|---|---|---|
92+
| identifier | `string` | Takes the id of a collection you want to loop through |
93+
| limit | `int` `string` |`optional` The number of collection items you want to display |
94+
| tags | `array` |`optional` Filter collection items based on tags listed in this prop |
95+
| className | `string` | `optional` Class name(s) that will be added along with "chunks-collection-wrapper" to the main collection `<div>` element |
96+
| itemClass | `string` | `optional` Class name(s) that will be added along with "chunks-collection-item--wrapper" to all collection items |
97+
98+
#### ChunkFieldValue Attributes
99+
|Attribute|Type|Description|
100+
|---|---|---|
101+
| identifier | `string` | Takes the identifier or field_name of a collection field |
102+
| className | `string` | `optional` Class name(s) that will be added in the chunk `em-span` element |
89103

90104
#### Using default chunks array as fallback:
91105

0 commit comments

Comments
 (0)