Problem/Motivation

Currently the "contact method" entities do not have their own dedicated theme templates.
I would like these to exist, since I want to adapt the theming of my contact methods.

For example, I want to override the template for the Telephone contact type, to be rendered as follows:

<div>{{ telephone }} ({{ detail }})</div>

This would then output a telephone contact method as:

+32 1234 56 78 90 (Home)

Proposed resolution

  • Add a theme hook
  • Add a template file
  • Add theme suggestions for bundle & view mode combinations

Issue fork crm-3569519

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

svendecabooter created an issue. See original summary.

svendecabooter’s picture

Status: Active » Needs review

I have added an MR that implements this functionality.

I think all template_preprocess_crm_* hooks in crm.module could probably also go in the ThemeHooks class, but I wanted to keep this MR as focussed as possible.

bluegeek9 made their first commit to this issue’s fork.

bluegeek9 changed the visibility of the branch 1.0.x to hidden.

bluegeek9’s picture

Status: Needs review » Fixed
//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support makes this project sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:
  • Triage issues and adding more context to existing issues.
  • Flagging CRM as a favorite on the project page to help others discover it and show your support.
  • Review the Developer Docs for accuracy and clarity.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.