Site logo

Archived topic

Ordered list problem

5 replies · Started by paddyd on July 29, 2022

Viewing posts 1–6 of 6

The page with the issue is: https://lbsc.ca/policies/ - it's in the Privacy Policy, Item 9, which has an ordered lower-case alphabetical list (lawyers...ya gotta love them) in 3 parts. I got the custom CSS working to enable the alphabetical list and then I added the start="7" etc. for each of the sections beyond the first one. It RENDERS fine - behaves as it should - BUT, as soon as I exit the Code Editor, I get the dreaded "This block contains unexpected or invalid content." - and of course, attempting block recovery just removes the start="7".

I have seen this sort of behaviour occasionally before (completely fine HTML that WP has a conniption over) - so do I just ignore it, or is there something I can do to make it happy? I'm not so much worried about my own activity on the page, but if someone else attempts to edit it down the road, they're not going to know to leave well enough alone.

Hi there,

if you're using the List Block, when you change it Ordered, there is Start field in the blocks sidebar settings. Why not use that to add the start attribute ?

Over here in the Doing-Things-the-Hard-Way Department, I completely missed the start option. Oops. :p

Related question - is there a way to target the list with a class so that I don't have to hand edit the code to add the type="a" etc.? I've tried all sorts of things, but can't seem to find anything that works. I could add the Advanced Editors Tools plugin (formerly known as Tiny MCE, which I used before I switched to GPP/Gutenberg) to have it readily available, but not sure I really want to do this for what is a relatively rarely used list type, except when dealing with lawyers, LOL.

Adding more list types to the list block has been under discussion for eons...https://github.com/WordPress/gutenberg/issues/17738 - it's a bit nuts that it's still not available.

Haha - i think i have a part time role in that department too

For the list style we can make a CSS rule like this:

ol.abc {
    list-style-type: lower-alpha;
}

Then add the abc to the Advanced > Additional CSS Classes on the OL List Block.

Thanks, David - it's all working beautifully now! Now to go add that CSS to a few other sites where lawyers (and planners) who all seem rather fond of complicated nested lists contribute content! :p

Glad to be of help!

This archived topic is closed to new replies.