sitecore - 如何在 sitecore 中获取用户 session 的当前角色?

标签 sitecore personalization

我正在使用 sitecore 配置文件卡。有没有办法获取映射的用户的当前角色。我使用的是sitecore 6.6

最佳答案

您可以使用 Analytics API 来执行此操作:

 var visit = Tracker.CurrentVisit;
 foreach (var profile in visit.Profiles)
 {  
   if (profile.ProfileName.ToLower() == "persona")
   {
      profile.UpdatePattern();

       // get the matching pattern text
      var matchingPattern = profile.PatternLabel;
   }
 }

关于sitecore - 如何在 sitecore 中获取用户 session 的当前角色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30092257/

相关文章:

asp.net - 我应该如何在 Sitecore 中存储/访问本地化 UI 字符串?

针对内部 DSL 的 Scala REPL 个性化

eclipse - 根据选择的工作区更改 Eclipse 的图标

dns - 如何创建自己的域名后缀?

Sitecore:获取转发器中droplink的值

pdf - Sitecore 在下载链接上显示 .pdf 扩展名

Sitecore 8.1 输出缓存未清除

xpath - 添加参数后快速查询失败

java - 使用 Lucene 进行个性化搜索

asp.net - 使用 ASP.NET + Cookie 进行匿名个性化的有效方法