Try our conversational search powered by Generative AI!

Mobile Visitor Group criteria for EPiServer

Vote:
 

I'm testing out 'Mobile Visitor Group criteria for EPiServer http://azanganeh.com/blog/2016/10/17/mobile-visitor-group-criteria-for-episerver/ an It works well on the website.
But in editorview and preview the block is hidden.

Why is editorview behaving different than the website? What can I do to make the editorview behave as expected? Not hide the block while visitorgroup 'desktop' is added.

#162997
Oct 18, 2016 15:19
Vote:
 

Describing this could be little a bit hard. There are two concpets in EPiServer edit mode called "ImpersonatedVisitorGroupsById" and "ImpersonatedVisitorGroupsByName"This is used by EPiServer in edit mode, to allow editors to preview pages as viewed by particular Visitor Groups. By default in edit mode it ignores the IsMatch, but you have ability to see page in perspective of different "Visitor Group":

I know the  concept it little a bit seems odd but correct in edit mode :) Hope it helped 

#163180
Oct 19, 2016 13:20
Vote:
 

Just in case this is EPiServer Code:

class EPiServer.Personalization.VisitorGroups.VisitorGroupRole

{

.....

public bool IsMatch(IPrincipal principal, HttpContextBase httpContext)
{
string[] strArray1 = httpContext != null ? httpContext.Items[(object) "ImpersonatedVisitorGroupsById"] as string[] : (string[]) null;
if (strArray1 != null)
return ((IEnumerable<string>) strArray1).Contains<string>(this.ID.ToString());
string[] strArray2 = httpContext != null ? httpContext.Items[(object) "ImpersonatedVisitorGroupsByName"] as string[] : (string[]) null;
if (strArray2 != null)
return ((IEnumerable<string>) strArray2).Contains<string>(this.Name);
bool isMatch = this.IsMatchCached(principal, httpContext);
this.AddVisitorGroupStatistics(isMatch, httpContext);
return isMatch;
}

.....

}

#163181
Oct 19, 2016 13:22
Vote:
 

Thank you for clearing that up.

I feel its a little bit anoying that the block dissapears when I set a visitorgroup. Its correct while 'View as this visitorgroup', the block is displayed as expected.

I guess its the best option that the editorview displays all content with no visitorgroups attached.

#163450
Oct 20, 2016 16:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.