Try our conversational search powered by Generative AI!

Remove empty div if ContentArea has an active visitor gourp and block is hidden



I am facing this issue that I want to remove empty div if there is an active visitor group on the block.

This is a content area which will only contain one block and that block is supposed to have visitor group (e.g. persons age < 35  )

When the person is over 35 the block is hidder but there is still an empty div. How can I remove that ?

<div class="col-xs-12 col-md-6 col-lg-3"> 
@Html.PropertyFor(x => x.CurrentPage.ContentArea)
Nov 25, 2021 13:58


You can check the content area items and see if any items are returned.

It is preferable to use the filtereditems property as this will apply personalization, etc.

More info can be found here

Alternatively you could get the current users visitor groups and check if they are in the specific group. This method is more limited however.


Dec 12, 2021 8:40
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.