- Issue created by @petednz
- Assigned to markusa
- πΊπΈUnited States markusa
Hey Peter
Yep, you can do this.
To be able to manage display for an entity type, and create additional view modes, first you have to enable the CiviCRM Entity type at /admin/structure/civicrm-entity/settings
Check "CiviCRM Contact" to be able to do this for contacts.
After that you'll be able to add View display modes /admin/structure/display-modes/view/add/civicrm_contact
Then you can navigate to the "Manage Display" page, /admin/structure/civicrm-entity/civicrm-contact/display
After you've made a custom view module, you'll see a field set at the bottom of the page, "Custom display settings"
Enable your new view mode
Save, and after that you'll see a submenu item underneat the tabs to manage the fields on the new display.Then you can configure the entity reference field on your node type, to use that display.
You can use different displays for different entity reference fields.Let me know if further questions!
- π³πΏNew Zealand petednz
Hi Mark - thanks for responding. Odd, I already had access to
/admin/structure/civicrm-entity/civicrm-contact/display
but had not been seeing civicrm contact as an option at /admin/structure/display-modes/view/add.
I am seeing it now. Not sure what was going on other than me having a blind spot. I do now so added a civicontact2 View mode
and yes therefore now I do see Custom Display Settings option at the bottom of the 'Manage display' form with
> Use custom display settings for the following view modes
and my new View mode. All as expected.
This has me worried for a bit till i decided it might be a typo
> After you've made a custom view module
I went on to modify my Display at admin/structure/civicrm-entity/civicrm-contact/display/civicontact2 (simply setting the Labels to Inline instead of Hidden so I can confirm I am seeing the changes)
I go to the Content Type, Manage Display, For one of my c-e entity reference fields I set it to Rendered Entity and via the 'cog' can set it to 'rendered as civicontact2'. so far so good.
I then go to a node of this type hoping that on refresh I will see my Labels. bingo.
That has done all the expected. not sure how the earlier settings wasn't visible but maybe too many mirrors.
Now I have to decide whether to persevere in this direction so that the three fields (image, name, employer) display as
Name
IMAGE
Employeror if i continue with the Views approach I took while scratching my head on this one.
I'll assume that the final step for managing how these fields actually display is going to be at the theme level (not my area) but happy to be put right if there is another tool I am unaware of.
Again, appreciate your response Mark.
- Status changed to Closed: works as designed
7 months ago 5:36pm 25 April 2024