Get Block Grid Group Alias / Name
# help-with-umbraco
d
I am trying to get the name or alias of the parent Group of Block List Items I am currently having to use a naming convention e.g. all layout begin with 'layout'
Copy code
@foreach (var item in Model)
{
    if (item.Content.ContentType.Alias.StartsWith("layout"))
    {
        layout = true; // Set the layout variable to true if the condition is met
    }
}
I would prefer to use the group which I can see is
blockGroup.name
in Angular
A massive thanks to @CodeSharePaul who found a way to retreive the Group alias. I have added it to #UmBootstrap and it works great. I think his solution will be very useful for anyone nesting Block Items
c
No probs mate, I will put it in a blog post soon
2 Views