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

Try our conversational search powered by Generative AI!

Alloy Sample Site. Where do we define what displayoptions can be applied to a block?

H F
H F
Vote:
 

Hello,

question:

exploring the Alloy site.  I have found the 'DisplayRegistryInitialization' page where we set up options for the display a page or a block (I guess?).

where can I see them via admin page?

Also why some of the blocks can not be viewed in different display options (JumbotronBlock can not be viewed in wide and narrow). Where do I set it up?

thank you for your help,

HF

P.S. I think it makes sense to make a room 'Allow site/Sample site(s)' so the new people to episerver can ask their beginners questions.. (suggestion to the admins of this forum)

#180746
Jul 24, 2017 20:07
Vote:
 

Hi,

This is not possible OOTB. You will need to modify some core parts (display option selector in this case). Here is thread and great solution from colleague of mine - http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=146515

#180748
Jul 24, 2017 23:04
H F
Vote:
 

hI Valdis,

no no, I am not trying to modify anything, just trying to understand how that works.. 

for instance 'where do I set up the display options for a block'?

thanks,

HF

#180749
Jul 24, 2017 23:07
Vote:
 

By default all registered display options are available for all blocks.

#180751
Jul 24, 2017 23:15
H F
Vote:
 

ok, but why then for the Alloy site if one goes to the admin part and look for the rendering of Blocks>Startpage>AlloyMeetJumbotron it says 'can't not be displayed as wide', 'can not be displayed as Narrow'.. I believe there are some settings that allow one to control what display option is available for a block?

thanks,

HF

#180763
Jul 25, 2017 15:52
Vote:
 

Ok, now I understood your question. Well answer for your question has 2 parts:

1) there is concept of display options and available templates for the specific block. Display options are something that is registered (usually in initializable module) and available under context menu (hamburger menu icon) for block while editing it in content area. these display options are available all for all blocks there is no restriction out of the box. Selected display option regulates something called rendering "tag". You can read more here.

2) Other part is available template for that block for selected rendering tag (or display option). AlloyTech sample site uses EPiServer API to get list of registered display options (Controllers\PreviewController.cs, Ln:47) and then detects whether this block is available for selected display option or tag (method `SupportsTag()` in the same controller). Method tries to understand whether this block has rendering template for display option (uses something called `TemplateResolver`).

So long story short - if you go to \Business\Rendering\TemplateCoordinator.cs class you will code that regulates what templates are available for which tags for which blocks.

Hope this helps!

#180768
Jul 25, 2017 21:25
* 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.