November Happy Hour will be moved to Thursday December 5th.

Adding a displayoptions(?)

Vote:
 

Hi,

Can I add another displayoptions for blocks? I need to sort the blocks in mobile-view.

Instead of this: 

(Cannot add images).. For blocks in a contentarea you have dropdownlist(?) that have name like: 

  • Edit
  • Display as
  •  - Half
  •  - One thirt (etc.)
  • Personilize 
  • Move up
  • Move down
  • Remove

I'd like to add another "Display as" that adds my class to the block in edit-mode for sorting in a mobile view so the editors can choose the sortorder for the block in EPi. 

I dont know if this even is possible and I might have to rethink this. 

//Robin

#264210
Sep 30, 2021 9:33
Vote:
 

Display options are setup as part of the custom code of your solution. The demo instance come with full, wide and narrow so these options you've got would have been custom.

https://world.optimizely.com/documentation/developer-guides/archive/cms/rendering/display-options-10-11/ 

This explains how to do it so you should search for IInitializableModule instance in your solution to find where these are configured.

#264212
Sep 30, 2021 10:06
Vote:
 

Hi Scott, thank you for the reply! 

I mean that i want another tab that is simular to the "DisplayOptions" but a new one. Is that achivable with IInitializableModule? I mean something like this: 

Original code: 

             {
   // Register Display Options
                var options = ServiceLocator.Current.GetInstance<DisplayOptions>();
                options
                  .Add("full", "/displayoptions/full", Global.ContentAreaTags.FullWidth, "", "epi-icon__layout--full")
                  .Add("wide", "/displayoptions/wide", Global.ContentAreaTags.TwoThirdsWidth, "", "epi-icon__layout--two-thirds")
                  .Add("narrow", "/displayoptions/narrow", Global.ContentAreaTags.OneThirdWidth, "", "epi-icon__layout--one-third");
                AreaRegistration.RegisterAllAreas();
              }

Instead i want this: 

             {
                // Register Display Options
                var options = ServiceLocator.Current.GetInstance<MyOwnCustomDisplayClass>();
                options
                  .Add("first", "/rendered_from_xml/name", custom.areatag.firstitem, "", "class-added-first")
                   .Add("second", "/rendered_from_xml/name", custom.areatag.seconditem, "", "class-added-second")
                  .Add("third", "/rendered_from_xml/name", custom.areatag.thirditem, "", "class-added-third")
                AreaRegistration.RegisterAllAreas();
              }

And then i want it to be added inside episerver when you click the hamburgermenu on blocks to be added on each contentareaitem. 

#264214
Sep 30, 2021 10:49
Scott Reed - Sep 30, 2021 12:58
Not out of the box, you'd have to create an extension to the DOJO editor in the CMS along with an API to power these options or inject them in to the script. It would be quite a bit of work to get that to work. If you're just try to create block sorting in a content area per device type you could create multiple content areas for each device profile which would allow independent sorting unless I'm mis-understanding the requirements.
* 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.