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

Allow users to choose what contact details are shown when inserting contacts in TinyMCE #3258

Open
1 task done
Tracked by #2955
charludo opened this issue Dec 3, 2024 · 0 comments
Open
1 task done
Tracked by #2955
Labels
effort: medium Should be doable in <12h feature New feature or request prio: high Needs to be resolved ASAP.
Milestone

Comments

@charludo
Copy link
Contributor

charludo commented Dec 3, 2024

Motivation

Requirement

Proposed Solution

Idea: use URL parameters to influence what fields are contained in the rendered contact card returned by the get_contact endpoint.

  • After selecting a contact in the TinyMCE contact insertion plugin, show (default-checked) checkboxes for each contact detail (name, email, phone,...). Which details are available can be read from the selected contact's URL, which should include all available fields (see below)
  • for each checked checkbox, append a URL parameter to the contact URL. For example, if email and name are checked, append something like ?details=email,name to the contact URL.
  • adjust the contact_card template to check for the presence of the field names in the details list, rendering only the present entries

It's probably a good idea to use this opportunity to refactor the update_contacts function to query the get_contact endpoint instead of calling render_contact_card.

This solution retains the contact URL as the single source of truth for the rendered contact cards, and #3169 has layn the foundation for making this a relatively easy-to-build feature.

Alternatives

Nothing simpler IMO

User Story

As an editor/author, I might want to include only certain contact details (for example: only name and phone number in cases where readers should make inquiries by phone, in order to dissuade them from using unsupported channels).

Design Requirements

I don't think so, a vertical stack of checkboxes & labels should be completely functional.

Related Issues

Depends on:

@charludo charludo added the feature New feature or request label Dec 3, 2024
@charludo charludo added this to the 24Q4 milestone Dec 3, 2024
@JoeyStk JoeyStk added effort: medium Should be doable in <12h prio: high Needs to be resolved ASAP. labels Dec 3, 2024
@JoeyStk JoeyStk modified the milestones: 24Q4, Next-up Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: medium Should be doable in <12h feature New feature or request prio: high Needs to be resolved ASAP.
Projects
None yet
Development

No branches or pull requests

2 participants