11

From my knowledge, there is a set of fields that can be rendered out using a FieldRenderer like text, numbers, dates, etc. Additonally, there are also fields that cannot be rendered out, such as fields that stores ID's or list of ID's, like links, references, etc.

Instead of hard-coding my knowledge, I would like to know if there is a way where I can check if a field (type) has FieldRenderer support, or not (in code). Is this possible?

8

You could create a function that checks the fieldtypes.. based on the renderField pipeline, which is executed in the fieldRenderer you should include these types:

  • rich text
  • single-line text
  • text
  • image
  • link
  • general link
  • internal link
  • multi-line text
  • memo
  • date
  • datetime
  • word document
  • integer
  • number

That should be the complete list (on a Sitecore 8.1).

There are some surprises in there, like "word document". But also note that DropList is not in there! (also mentioned here that droplist is supported by <sc:text> but not by the FieldRenderer.

|improve this answer|||||
8

Every field can be passed through FieldRenderer. The <sc:FieldRenderer> control makes use of the FieldRenderer.Render static method, which can be used on any field.

FieldRenderer.Render passes the field through the field rendering pipeline.

Whether or not the text in a given field is actually transformed by the field rendering pipeline is an entirely different matter.

By default there are a limited set of field rendering pipeline handlers, but these are completely configurable, so it will depend entirely on whether or not the project you're working on has had its field rendering pipeline customized.

|improve this answer|||||
  • 1
    While this answer is not as comprehensive as the marked answer, I agree with the statement that every field can go through the FieldRenderer.Render method. Just what comes out the other side is definitely a different story. – Pete Navarra Oct 28 '16 at 4:02
3

As far I know all the fields from bellow images can be rendered with FieldRenderer control. All the fields that can be renderes using sc:Link, sc:Image, sc:Date or sc:Text

enter image description here

enter image description here

|improve this answer|||||
  • Not all fields that can be rendered with sc:Text are supported by the FieldRenderer apparently. So this list is not accurate.. – Gatogordo Oct 18 '16 at 14:33

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.