Adding a numbered headings to a list by block

Hi,

I’m not sure if this has been asked before, but is there a way of adding a heading for each entry in a list by block that changes on each block? e.g. Property 1, Property 2.

ID and Order are showing as huge numbers, not 1 or 2.

Also, is there a way of hiding Add Above/Add Below on list by block edit? Not necessary, but I’m trying to avoid any confusion.

Thanks

Morning Victoria,

Regarding the number of blocks, please refer to Bob’s answer below.

As for hiding the add above and below buttons, we can do that.

Add a class name to your block edit widget in the advanced section of pagebuilder settings.

image

This will allow us to target only this widget and not all Block Edit widgets.

Next you will need to add some css to the Late style sheet of the theme applied to your target interface.

If you don’t have one, first check which interface you are using (Name in dropdown from header). Next go to Interface on build and check which Theme is set in the Basics Tab. Then go to Themes, open the correct theme and check for a Late Style Sheet. If one doesn’t exist you can add one.

Add the following css:

.hideme .below_this_row, .hideme .above_this_row{display:none !important};
.hideme .remove_existing_table_row_listing{border-left: 1px solid !important; border-right: 1px solid !important;};

image

This will hide the above and below and add borders to the now solitary delete button.

image

Hope this helps.

Although Create doesn’t offer a block index you can show, you could add this purely with CSS, by adding a custom class to your block list, and another to one of the fragments in each block.

The exact CSS for the second part will differ based on the fragment type you use (your CSS needs to drill down to the text being shown for that fragment), but something like this will prefix each of my fragments (with class “numbered-block-title”) with an incrementing number and colon…

.numbered-block {
    counter-reset: numbered-block-counter;
}

.numbered-block .numbered-block-title .fragment_presenter_template_show span.value-as-text::before {
    counter-increment: numbered-block-counter;
    content: counter(numbered-block-counter) ": ";
}

Note that this is purely based on the order of blocks shown on screen, the numbers do not actually correlate to the records in any way, so when changing the sort order for example the numbers will remain in order.

1 Like

Inspired @bob.twells :slight_smile:
Every day is a school day!

Brilliant! Thanks guys, I’ll give those solutions a go - always good to know I’ve not missed something obvious on the front end.