0

I created SXA Tags in the Sitecore and I know how to add this tag to an item but I want to add the required field validation to the Tag fields, so I can not save the items without adding tag to it.

Do you have any ideas?

1

You need to select Required validation rule for all the validation rules section in the template for your desired field:

  • Quick Action Bar
  • Validate Button
  • Validator Bar
  • Workflow

Best would be to duplicate OOTB Required validation rule and set "Result" parameter to "FatalError". Name the validation rule as "Fatal Required" or something similar.

In other words, set Result=FatalError inside the Parameters field of your duplicated Required validation rule:

enter image description here

Then you can use it as a validation rule and it will disable content editors to save pages without specifying Tags field:

enter image description here

enter image description here

  • Are you aware of how to do maximum length validations in SXA – user2332873 Oct 19 '18 at 15:40
  • Take a look on "Max Length 40" validation sample rule and create similar with your desired maximum length value – Peter Procházka Oct 19 '18 at 15:45
  • Once a rule is created do you assign it partial design or Page design Level in SXA – user2332873 Oct 19 '18 at 15:52
  • You need to assign it on field level – Peter Procházka Oct 19 '18 at 16:07
  • since its SXA and field is reusable applying validation at field level would assign this validation rule to all components. – user2332873 Oct 19 '18 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.