Changing listStyle of blocks [solved]

Hey folks,

I want to change the listStyle of a block.
setting the property is not working (read only?)

How can I change the listStyle of an existing (selected) block from “none” to “bullet” in an extension?

Hi @FlohGro

listStyle is mutable so you should be able to modify it.

How do you change the property?
It is not a simple string, but an object, so you need to set value like this { type: “bullet” }

You can also check the Craft PowerTools sample extension, that has an Advanced Actions section. In that, the “Convert empty toggles to bullet” button should do something similar.

Hope this helps!

1 Like

Thanks I’ll look into it. I used a simple string. After reading your answer I’m not surprised it didn’t work :slight_smile: