3

My client has 12 sites, most of which have a specific language that the entire site is in. Editors are multilingual and jump between sites, forgetting to change the language in the upper right of the Content Editor. I would like to configure Insert Options Rules based on the language that is present in the Item.

To my surprise, the rule where the item language is equal to nl-NL does not actually look at the item and whether it has a language-field with value nl-NL, it simply looks at the language selected in the upper-right. So when they right-click on an item that only has a language: en version, but they were just editing in a nl-NL website, they see the Insert Options for nl-NL rather than en.

I've tried the where the specific field compares to specific value rule with language field being equal to the value nl-NL but that doesn't work, the Insert Option never shows up anywhere under any circumstances.

My work-around is to use the where the item is the specific item or one of its descendants rule, but seeing as there's already 12 and possibly more in the future, times the number of rules we'll have for different insert options, this is not the best maintainability for us.

Is there a better way to do this? Ideally actually reading the present language-fields of an item?

1 Answer 1

3

I don't think the Rules Engine can really help you here. The reason being; it comes with a lot of pre-baked conditions related to items. As opposed to item versions.

I've done something else for a lot of projects I've been involved in however. Either as-is, or I've made some tweaks based on actual requirements.

Jan Bluemink has an Open Source module called "Content Editor Warnings", which I've found to be super helpful.

It basically warns the editors, if what they're currently doing matches expectations. Much like the conditions you would validate for with the Rules Engine.

enter image description here

It supports popular features such as Language Fallback and SXA.

Available here:

2
  • We're already using that very plug-in indeed :) But when editors don't first left-click on the item to see that Switch-dialogue before right-clicking to insert something new, they're presented with the wrong insert options. I'm just gonna have to be clever with the work-around. Thanks anyway!
    – asontu
    Nov 28, 2018 at 9:09
  • Right, yes. If you really wanted to, you could create an Insert Rule (not to be mistaken with an Insert Rules Engine Rule - not confusing at all :P). It's a bit of C# code that executes for insert options. In that, it would be possible to do more specific logic to suit your needs. For example, see: geekhive.com/buzz/post/2017/11/…
    – Mark Cassidy
    Nov 28, 2018 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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