Problem/Motivation
The module "Hierarchical Term Formatter" Hierarchical Term Formatter is not compatible with Custom Field.
Steps to reproduce
Create a Custom Field and a sub-field as an Entity Reference to a Taxonomy Term: the Hierarchical Term Formatters do not appear as possible formatters to be chosen, both in Manage Display of the Entity and in Views.
Proposed resolution
Create formatter for entity reference terms similar to Hierarchical Term Formatter.
Issue fork custom_field-3486757
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
apmsooner commentedThis is not a bug. Custom field has it's own subfield plugin architecture so other contrib module formatters normally only affect the field itself but not its properties. Changing this to a feature request.
Comment #3
giuse69 commentedOk, I hope this feature request can be implemented since I am using extensively Custom Field and where there are taxonomy term references that need to be displayed in their hierarchy path, I cannot use the Custom Field :)
thanks a lot in advance
cheers
Comment #4
giuse69 commentedComment #5
apmsooner commentedI like the idea. I've looked at the other module and it shouldn't be too hard to replicate but it may take a bit for me to get to it. I want to thing about the wrapping html elements part as well as that could be something that may apply to all custom field type formatters for enhanced theming. I'll get back to this one as soon as time permits.
Comment #7
apmsooner commentedPlease test the patch and see if it works for you. It's basically the same implementation as the referenced module, just modified to work with custom_field.
Comment #8
giuse69 commentedHi, it works great as a formatter in the Display of an entity - thanks!, it does not appear when the subfield is used in a view.
cheers
Comment #9
apmsooner commented@giuse69 - none of the formatters are currently available in views for individual sub fields, however if you select the field itself... each subfield's formatter can be selected in views. Can you tell me if you are seeing the option for the latter? For the former, thats a separate issue that I could look into later.
Comment #11
apmsooner commentedI was able to verify the new formatter is available in views when the field itself is selected. No formatters are currently available for individual selected subfields which is a separate issue that can be resolved separately. Otherwise, merging this as it solves the initial requirement.
Comment #12
giuse69 commentedok, the usage of formatters defined in the subfield definition is infact a cross request, see also https://www.drupal.org/project/custom_field/issues/3473418
Comment #13
giuse69 commentedComment #14
apmsooner commented