1

My question might be a little complex, but I appreciate any help:

I am using SitecoreFieldSuite by Velir, in my Sitecore 8 solution. Officially, SitecoreFieldSuite isn't supported in Sitecore 8, but I have to continue with it for legacy reasons.

SitecoreFieldSuite includes the FieldSuiteImageListItem field type.

The issue that I'm facing is that while a user can choose any image(s) from media library and will see the selected image(s) in the field, the selection doesn't actually create a link between the item and the selected media library items. What I need is to be able to see which items use a given item from the media library. The value of the FieldSuiteImageListItem field type is a pipe-delimited list of IDs.

Does any one know a good way to make a link between these items, in this case?

4

Well, I've been in the archives ;-) Now I cannot say for sure, the solutions I list here will still be applicable in Sitecore 8. What I can say though, is that Sitecore will add LinkDB references to your fields and image items given that certain conditions are met:

  • The Field Suite fields are defined in /App_Config/FieldTypes.config. Check this first. It is not enough to have them defined only in the core database.
  • The implementation of the fields must inherit from a Sitecore standard field - in your case a DelimitedField.

Looking at the source you listed, the latter does not appear to be the case and that might be why it doesn't get registered for you (if, indeed, you are certain the fields are configured in FieldTypes.config).

Mark Stiles blogged about this in 2013. Adding Fields To The Link Database. Mark specifically mentions using FieldSuite in this blog post, and mentions how he worked around it by inheriting the fields differently. He does not provide a full example, but he does list the 3 conditions required for any field:

  • It should be a subclass of the Sitecore.Data.Fields.CustomField class.
  • It should override the CustomField ValidateLinks method.
  • It should have a constructor that takes a Sitecore.Data.Fields.Field object as an argument.

To me it looks like you need to tweak your base class FieldSuiteListItem class and make it inherit DelimitedField - and then fix whatever the compiler requires you to because of this. That would be where I would start, anyway.

edited to clarify

Fieldtypes.config lives in the App_Config folder. Alongside Sitecore.config in recent versions. It is included from Sitecore.config here:

<fieldTypes>
  <sc.include file="/App_Config/FieldTypes.config" />
</fieldTypes>

And as Zachary points out below, these fieldTypes can indeed be patched using normal Sitecore config patching techniques. ‎‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎

  • Just to clarify, FieldTypes.config lives in the App_Config folder directly, not the Include folder, so it is pulled in explicitly. However, you should have no problem adding your custom field types to a patch (one that lives in the Include folder) for the FieldTypes.config. Right, Mark? – Zachary Kniebel Feb 17 '17 at 16:34
  • Yep. Edited to further clarify. – Mark Cassidy Feb 17 '17 at 16:43
  • Any updates on this? The link is dead... – Marcel 2 days ago

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.