Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop reference tags into more of a "feature" #3358

Open
timkelty opened this issue Oct 9, 2018 · 3 comments
Open

Develop reference tags into more of a "feature" #3358

timkelty opened this issue Oct 9, 2018 · 3 comments

Comments

@timkelty
Copy link
Contributor

timkelty commented Oct 9, 2018

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: Make reference tags localizable #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

@khalwat
Copy link
Contributor

khalwat commented Oct 9, 2018

Though it'd deprecate Rich Variables, I'd tend to agree. I think the UX for such a thing is the tricky part, though. I guess any Element could have a "Copy Rich Text Reference" or such, which could then be pasted into any RTF field.

The awkward part is that ideally, you have some more friendly GUI that lets them do this right there from the RTF editor (which is what Rich Variables does, but just for Globals).

@timkelty
Copy link
Contributor Author

timkelty commented Oct 9, 2018

which is what Rich Variables does, but just for Globals

Apart from links, which Redactor, et. al. uses – globals are the most common use-case. e.g…

  • client has a phoneNumber global that they want to include in a rich/plain text field.
  • The only good option it to use refs, but they have no way of knowing what the ref tag is (they need a global set ID, which you can really only get by looking at the DB).

A good first step might be fixing refs for multi-site, and providing a "copy reference tag" action for all elements, like assets have.

@piotrpog
Copy link

I guess any Element could have a "Copy Rich Text Reference" or such, which could then be pasted into any RTF field.

I think that for now, its good idea for plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants