Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Block ContentLink from Visitor group criterion


I am writing a custom visitor group criterion. And i need contentlink to block that has the visitor group currenly is evaluating.

    public class EventViewCriterion : CriterionBase
        public override bool IsMatch(IPrincipal principal, HttpContextBase httpContext)
            // How do i get block ContentLink from here.
            return false;

    public class EventViewCriterionModel : CriterionModelBase
        [Required, DojoWidget(SelectionFactoryType = typeof(EnumSelectionFactory))]
        public ComparisonType Condtion { get; set; }

        public int ViewCount { get; set; }

        public override ICriterionModel Copy()
            return base.ShallowCopy();

Regards Øyvind

Jan 09, 2017 13:15

I would look at httpContext.Request.QueryString. It should have the content id thats being evaluated. You'll need to load the content and evaluate from there.

Don't forget to keep performance in mind!

Jan 09, 2017 14:15

Hi David

Thanks for your reply.

There is nothing in httpContext.Request.QueryString. If i pass something in querystring there is something. :)


In this case i will see the userid in querystring, nothing else

A little bit more info

I have a userdataservice that contains data about current user and most important in this case events on the blocks on the page. Block closed can be one event. Or viewed is another event.

Editors wants to make visitor groups on theese events ( lot more but right now i am working on the events).

One example can be a rule on content block viewed less than 5 times (criterion). Or block not closed (if block is a dismisable alert).

Edited, Jan 09, 2017 15:13
* 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.