Try our conversational search powered by Generative AI!

Random display of Bocks from content area & Visitor groups

Vote:
 

Hi,

I'm looking for a way to determine in code if a block should be included in a collection based on if it is in visitor group.

                List blockList = new List();
                if (model.CurrentPage.BannerContentArea.Items.Any())
                {
                    foreach (var c in model.CurrentPage.BannerContentArea.Items)
                    {
                        var item = contentLoader.Get(c.ContentLink);
                        // filter based on visitor group
                        blockList.Add(item);
                    }
                }
                HomeBannerBlock[] blocks = blockList.ToArray();

I have multiple blocks in a content area. Looking for a way to filter out personalised blocks if not required.

#147348
Apr 12, 2016 17:26
Vote:
 

Editors can personalise Block in online center.
/K

#147349
Apr 12, 2016 17:54
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.