0

Preamble:

Sitecore supports having content editors see a customized field title, however this field title is shared across every item that inherits this item.

For Image Fields I'd like to indicate to my content editors that there are recommended image dimensions, however these image field templates are reused in several places and each place requires a different dimension.

Some would say "Just use a field validator" my content editors frequently ignore them and basically if there isn't a big sign waving around saying "Hey there is an issue here" or gentle guidance, they'll ignore it.

Id also like to avoid something heavy weight like the getContentEditorWarnings pipeline checking all the fields.

Question:

Is it possible to have dynamically generated field titles in the content editor based on the item template?

Is there a processor that I can tap into?

Or should I just list all possible dimensions for that field and hope they pick the right one?

1

The short answer is, no there is not a place you can hook into for this.

As for other options, a general good practice would be to not inherit that field for every single derived template and have unique fields for each part, then you can fill out the short and long help text for those fields to be specific to that field. Ultimately, help text is part of a field, so if you want 2 image fields to have different help text, then create 2 fields for that rather than have a base template with an image field on and inherit that everywhere.

A similar question was asked a few years ago and this was the consensus then, I believe it still applies today: https://stackoverflow.com/questions/23829507/if-i-have-a-field-in-a-base-template-in-sitecore-can-i-vary-its-title-depending

  • it may be good practice, however when they are both being used the exact same way (and with glass mapper) it doesnt seem as good. For example, my website uses a series of carousels they are all the same with the exception of the image sizes. does it really make sense to have a unique class for each one? – Adam Hess Aug 9 '19 at 20:11
  • That's up to you, if you want unique help text per Carousel then your only option is to have unique fields. Its an architectural choice. – Richard Seal Aug 9 '19 at 20:12

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.