Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

ContentArea.FilteredFragments does not filter unpublished

Vote:
 

I have a ContentArea wrapped in some HTML that should not be visible if none of the Content inside is visible for the user.

@if(CurrentPage.MyContentArea.FilteredFragments.Any())
{
    <h3>Some heading</h3>
    @Html.PropertyFor(m => m.MyContentArea)
}

Though ContentArea.FilteredFragments does not seem to consider whether the Content is published or not, only on SecurityDescriptors and Visitor Groups.

When adding a Page that is still not published in an empty ContentArea, CurrentPage.MyContentArea.FilteredFragments.Count() returns 1, meaning an IF-statement CurrentPage.MyContentArea.FilteredFragments.Count() > 0 or CurrentPage.MyContentArea.FilteredFragments.Any() is useless unless I manually filter unpublished Content.

Hence the HTML wrapping my ContentArea will be visible but my Page from the ContentArea is not due to its publish state.

Is this a bug or is it supposed to work this way? Is there any other way to get

#72429
Jun 17, 2013 13:41
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.