Try our conversational search powered by Generative AI!

Get current DisplayOption for block

Vote:
 

Hi!

Is there a way to get the current display option for current block in episerver 7.5?

Regards/Crille

#131784
Aug 05, 2015 11:07
Vote:
 

Hi,

I think that DisplayOption  is set on ContentArea item not on block. This is because you could have different DisplayOptions on the same block in several contet areas.

The code to get display option from content area item:

ContentArea ca;

foreach (var item in ca.FilteredItems)
{
    DisplayOption loadDisplayOption = item.LoadDisplayOption();
}
#131787
Aug 05, 2015 11:24
Vote:
 

You can get the display option ID from RenderSettings property and then load the display option.

Are you using MVC or Webforms?

#131812
Aug 05, 2015 23:15
Vote:
 

Hi

Using Webforms. And using .LoadDisplayOption() worked fine for my problem.

Thanks for the help =)

#131817
Aug 06, 2015 9:16
* 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.