Umb V10.6.1
I need a particular BlockList to render with an extra class on the automatically rendered div. Is there a way to do this? AIUI the Settings Model will only affect the individual list Item and not the outer div. Basically I want to set it as 'display: flex' and a few other atribs in addition to 'umb-block-list'. There doesn't seem to be a blocklist css file like there is for the block grid.
Thanks.
j
JigitalCharlie
09/20/2023, 2:14 PM
Hi @Craig100 what do you mean by this?
JigitalCharlie
09/20/2023, 2:15 PM
What do you want to achieve maybe there is a different or better solution? Sounds a bit strange 😛
c
Craig100
09/20/2023, 2:19 PM
I want these to be in a row, not a column and I want them to wrap if there are more. They're from a BlockList that used to be Nested Content
d
Dean Leigh
09/21/2023, 7:27 AM
Hey Craig,
you could add a conditional in the Block List code:
Copy code
<div class="umb-block-list">
@foreach (var block in Model)
{
if (block?.ContentUdi == null) { continue; }
var data = block.Content;
@await Html.PartialAsync("blocklist/Components/" + data.ContentType.Alias, block)
}
</div>
e.g. add display:flex; then a variable for flex-direction: row or column as required
c
Craig100
09/22/2023, 3:14 PM
Thanks for that. I changed something else, entirely unrelated (or so I thought), and it's suddenly in a row. But I'll remember your's for next time. 🙂