Support » Plugin: Block Lab » How to create a custom List Block?

  • Resolved jdforrest

    (@jdforrest)


    Hello! I just started working with the plugin and I can’t seem to figure out how to create a custom list block.

    Currently, I’ve created a text block that is wrapped in an li tag in the template, but that means I’d have to add a block for every item in the list and that can’t be the only solution.

    Please help! Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @jdforrest,
    It’s possible to pass <ul> and <li> tags to the Textarea field, though in the future we might have a better solution for this.

    So instead of using a Text field, you could pass something like this to a Textarea field:

    <ul>
            <li>First Example</li>
            <li>Second Example</li>
    </ul>
    

    Is that what you had in mind?

    jdforrest

    (@jdforrest)

    Unfortunately no, that is not what I had in mind. While this solution works for me, my client cannot handle even the smallest amount of code. She likes the list block built into the Gutenberg editor and I’m trying to emulate that behavior where the user can just type strings into the single block and it will create the separate list items.

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @jdforrest,
    Ah, OK. Unfortunately, no great solution for entering lists in a field without markup comes to mind.

    You’ve probably considered the native Core List block, so I take it that it won’t work.

    Maybe the Repeater control would help, but it sounds like even that wouldn’t be ideal:

    https://github.com/getblocklab/block-lab/pull/298#issuecomment-514016429

    The Repeater is planned for the Pro license, and is still a work in progress.

    jdforrest

    (@jdforrest)

    Okay, thank you for your suggestions. I especially appreciate the swift responses. I will call this resolved.

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Thanks, @jdforrest! Thanks for using Block Lab!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.