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.

Command icon 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

giuse69 created an issue. See original summary.

apmsooner’s picture

Title: Incompatibility with Hierarchical Term Formatter » Hierarchical Term Formatter for entity_reference terms
Category: Bug report » Feature request
Issue summary: View changes

This 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.

giuse69’s picture

Category: Feature request » Bug report

Ok, 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

giuse69’s picture

Category: Bug report » Feature request
apmsooner’s picture

I 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.

apmsooner’s picture

Status: Active » Needs review

Please 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.

giuse69’s picture

Hi, 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

apmsooner’s picture

@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.

  • apmsooner committed 23d751ac on 3.0.x
    Issue #3486757 by apmsooner, giuse69: Hierarchical Term Formatter for...
apmsooner’s picture

Status: Needs review » Fixed

I 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.

giuse69’s picture

Status: Fixed » Active

ok, 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

giuse69’s picture

Status: Active » Fixed
apmsooner’s picture

Status: Fixed » Closed (fixed)