Skip to content

Commit

Permalink
feat(block): Added nesting to accordion block
Browse files Browse the repository at this point in the history
  • Loading branch information
holmey committed Apr 1, 2023
1 parent 80e6b27 commit 109687c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions site/blueprints/pages/article.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ tabs:
fields:
text:
type: blocks
fieldsets:
- accordion

- width: 1/3
sections:
Expand Down
15 changes: 7 additions & 8 deletions site/plugins/block-factory/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
panel.plugin("cookbook/block-factory", {
blocks: {
accordion: `
<div>
<div v-if="content.summary">
<details>
<summary>{{ content.summary }}</summary>
<div v-if="content.details" v-html="content.details"></div>
<div @dblclick="open">
<h2 class="k-block-type-accordion-heading" v-html="content.headline"></h2>
<div v-if="content.accordion.length">
<details v-for="(item, index) in content.accordion" class="k-block-type-accordion-item" :key="index">
<summary>{{ index + item.summary }}</summary>
<div v-html="item.details"></div>
</details>
</div>
<div v-else>
No content yet
</div>
<div v-else>No items yet</div>
</div>
`,
},
Expand Down

0 comments on commit 109687c

Please sign in to comment.