# Suggestions on implementing accordion UI in template

**URL:** <https://forum.getkirby.com/t/suggestions-on-implementing-accordion-ui-in-template/27668>\
**Category:** Questions\
**Tags:** v3\
**Created:** [January 23, 2023, 6:14pm UTC](https://forum.getkirby.com/t/suggestions-on-implementing-accordion-ui-in-template/27668 "2023-01-23T18:14:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodrigogalindez](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/rodrigogalindez/32/4903_2.png) [@rodrigogalindez](https://forum.getkirby.com/u/rodrigogalindez)\
**Post date:** [January 23, 2023, 6:14pm UTC](https://forum.getkirby.com/t/suggestions-on-implementing-accordion-ui-in-template/27668/1 "2023-01-23T18:14:35Z")

</div>

Hi there! I have the current setup:

 ![Screenshot 2023-01-23 at 19.05.43](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/3/357af24924f5714af10aa696302874d229fbf703.png)

As you can see, there’s some text wrapper in an “accordion” interface element. This text is shown when the user clicks in the “+”.

Currently the full text is just a field with `type: textarea`, and I’m using `kirbytext()` to render it in the template. This works well not because I only have paragraphs, but I’m not sure how to implement this “accordion” right in the middle of the text.

Where should I be looking at or how would you suggest to resolve this? Thank you.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 23, 2023, 6:27pm UTC](https://forum.getkirby.com/t/suggestions-on-implementing-accordion-ui-in-template/27668/2 "2023-01-23T18:27:01Z")

</div>

So you want a way to continue writing your text as normal but be able to integrate an accordion whereever you need, i.e. without having the accordion in a separate field?

1. KirbyTags
2. Use the blocks field with a custom accordion block:

> **[Blocks](https://getkirby.com/docs/reference/panel/fields/blocks)**
>
> A visual editor for long-form text and modular pages

> **[Block factory: Creating your own blocks collection](https://getkirby.com/docs/cookbook/panel/block-collection#accordion-block)**
>
> Start your own block collection based on examples in this recipe

---

<div class="post-metadata">

**Author:** ![rodrigogalindez](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/rodrigogalindez/32/4903_2.png) [@rodrigogalindez](https://forum.getkirby.com/u/rodrigogalindez)\
**Post date:** [January 23, 2023, 10:40pm UTC](https://forum.getkirby.com/t/suggestions-on-implementing-accordion-ui-in-template/27668/3 "2023-01-23T22:40:04Z")

</div>

Thank you! I’m trying to set a standard text block with some test content to be shown by default. However, it won’t show in the Panel. Not sure what I’m doing wrong. The blueprint:

```auto
title: 'References'

tabs:
  # title & SEO
  seo:
    label: 'SEO'
    icon: search
    fields:
      web_title:
        label: 'SEO Title'
        type: text
        help: 'lorem'

      web_meta_description:
        label: 'SEO Meta description'
        type: text
        help: 'lorem'

      tags:
        label: 'Tags'
        type: tags

  # content
  content:
    label: 'Content'
    icon: text
    columns:
      main:
        width: 2/3
        sections:
          fields:
            type: fields
            fields:
              cover:
                label: 'Cover Image'
                type: files
                multiple: false

              header_title:
                label: 'Header Title'
                type: text

              header_intro:
                label: 'Header Intro'
                type: textarea
                buttons:
                  - bold
                  - '|'
                  - link
                  - email

              text2:
                  type: blocks
                  default:
                    - type: text
                      content:
                        text: test content

              text:
                label: 'Text'
                type: textarea
                buttons:
                  - bold
                  - '|'
                  - link
                  - email

              text_image:
                label: 'Text Image'
                type: files
                multiple: false
      sidebar:
        width: 1/3
        sections:
          files:
            label: 'Files'
            type: files

          pages:
            label: 'Pages'
            type: pages
            template: industries-inner

```

What I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 24, 2023, 8:05am UTC](https://forum.getkirby.com/t/suggestions-on-implementing-accordion-ui-in-template/27668/4 "2023-01-24T08:05:26Z")

</div>

Your blueprint should work fine, but keep in mind that default content is only ever added at page creation, not when you add the field after that.

---

<div class="post-metadata">

**Author:** ![rodrigogalindez](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/rodrigogalindez/32/4903_2.png) [@rodrigogalindez](https://forum.getkirby.com/u/rodrigogalindez)\
**Post date:** [January 24, 2023, 1:21pm UTC](https://forum.getkirby.com/t/suggestions-on-implementing-accordion-ui-in-template/27668/5 "2023-01-24T13:21:19Z")

</div>

Oh, makes sense. Thank you!
