craftcms / craftcms/cms

Develop reference tags into more of a "feature"

Open
#3,358 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

In their current state, reference tags feel more like a developer-centric stop-gap than a fully considered feature of Craft.

I would love to see reference tags become more of a feature (selling-point of Craft) for CP users.

Rich Variables takes a step in this direction, but I'm imagining more core-level support.

Current issues

  • 🐞 References tags are not multi-site, making them unusable, and/or broken in certain cases: https://github.com/craftcms/cms/issues/2956
  • Many ref tags keyed by IDs, which are never exposed in the Craft CP (esp. globalset).
  • Plugin developers cannot extend anything to their own ref tags/element types.
  • parseRefs needs to be manually called on ANY field that may contain a ref tag for consistent behavior

Brainstorming

I'm imagining a field-level option "Parse Reference Tags" (alongside "Translation Method"), that would automatically parse a field's output for reference tags.

That option could then also be an indicator to the field to render some kind of "parse refs UI/selector" – basically an elementIndex modal where you could search through any elements and pop a ref tag into your field.

/cc @khalwat

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the reference tags documentation and the linked multi-site issue #2956, then compare the listed limitations with the proposed field-level option and selector UI. The issue does not name files or tests; completion would require an agreed core design covering multi-site behavior, plugin extensibility, parsing, and CP selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, content
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.