0

The "View as Visitor Group" option only shows in the EPiServer editor when there is content for visitor groups added to the rich text areas. If you have code based customisations then this makes it hard to preview your changes.

enter image description here

Is it possible to trigger this to show all the time or based on some decision in code?

Currently the workaround is to temporarily add some visitor group content to a text area, save & view, then "View as Visitor Group", then delete the temporary content in the text area before saving which isn't ideal.

This is EPiServer 6R2 (aka 6.1)


Original question: http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=74864 (lifeless forum, ugh). Posted here as I also want to know the answer as I'm working on similar functionality to the original author.

Tim Abell
  • 11,186
  • 8
  • 79
  • 110

1 Answers1

1

There is an interface IPersonalizedRoles that makes the View as visitor group menu appear if it is implemented on a property. However I think you have to create a custom property to use the interface yourself.

The SDK for the interface: http://world.episerver.com/Documentation/Class-library/?documentId=cms/7/68f4d6ca-e9a5-884d-4ca8-e5431a345112

You implement GetRoles() and return an IEnumerable with the visitor group GUID ID:s that you want to show up in the list.

Maybe you can create a custom dummy property and return your groups there?

Andreas
  • 1,355
  • 9
  • 15
  • EPiServer 6r2 sdk doc for same http://sdk.episerver.com/library/cms6.1/html/AllMembers_T_EPiServer_Personalization_IPersonalizedRoles.htm – Tim Abell Jun 30 '14 at 08:52
  • I must confess I don't entirely follow what you suggest. However it seems I don't really need the feature at the moment so I'll just accept and move on. Thanks for the help. – Tim Abell Jul 03 '14 at 13:33