Skip to main content
Source Link
iusmar
  • 239
  • 1
  • 2
  • 14

Custom Personalization rule: hide component if url contains a regex condition

I need to create a personalised rule that hides the component if the url contains a certain pattern and I'm a bit stuck in an early phase. I have two questions:

  1. What condition should my personalization rule class implement (is StringOperatorCondition ok?)? I assume have to read data from HttpContext.Current.Request, check if it matches my desired pattern and then returns true or false in the Execute() override method? Is this the case?

  2. Do I still need to add Conditions/Action in the Element Folder (/sitecore/templates/System/Rules/Taxonomy/Element Folder) since I don't want to parametrize the code behind?

pls dont yell I'm learning ty