cms icon indicating copy to clipboard operation
cms copied to clipboard

[6.x] Bring back type column in relationship selector

Open duncanmcclean opened this issue 1 month ago • 1 comments

This pull request aims to bring back the "Collection" and "Taxonomy" columns in the relationship selector.

In v5, the type column was hardcoded into the Listing component and only knew how to deal with collection and taxonomy arrays.

This PR brings it back as a "real" column called type, with a customised cell slot in the relationship selector listing. Maybe we should call it something else to avoid possible conflicts in addons? 🤔


[!NOTE] Brings back a proper type column (Collection/Taxonomy) in relationship selector listings with UI badge rendering and server-side column definitions.

  • Frontend (Relationship Selector)
    • Add #cell-type slot rendering a Badge for the type column in resources/js/components/inputs/relationship/Selector.vue.
    • Pass isColumnVisible to table cell slots; import/register Badge.
  • Backend (CP Resources)
    • Make setColumns methods protected to allow overrides in Entries and Terms.
    • Define a new listable, sortable type column in EntriesFieldtypeEntries (label: “Collection”) and TermsFieldtypeTerms (label: “Taxonomy”).
    • Map type values in ListedEntry and ListedTerm to the entry’s collection title or term’s taxonomy title.
    • Remove hardcoded taxonomy column from Terms (superseded by type).

Written by Cursor Bugbot for commit f311fe7b2665507c987ebb436e1d6c74c934116b. This will update automatically on new commits. Configure here.

duncanmcclean avatar Nov 25 '25 15:11 duncanmcclean

Where can I test this out? I can't think of how to see Entries and Terms in the same listing 🤔

jackmcdade avatar Dec 10 '25 22:12 jackmcdade

Where can I test this out? I can't think of how to see Entries and Terms in the same listing 🤔

  1. Create an entries/terms field, using stack selector mode. Don't limit it to a certain collection/taxonomy.
  2. You'll see new "Collection" / "Taxonomy" columns when you open the listing stacks.

duncanmcclean avatar Dec 11 '25 09:12 duncanmcclean