Problem/Motivation

We want to support all core content entity types!

This issue is to add a 'PanelizerEntity' plugin to provide support for 'user' entities.

Here's a rough idea of the process:

  • Create the plugin class in src/Plugin/PanelizerEntity/ directory
  • See src/Plugin/PanelizerEntity/PanelizerNode.php for an example!
  • If the entity has a 'view_builder', look at it's code for anything that makes the entity special
  • If this entity needs any special blocks for it's default display, for example, like the 'node links' block, create issues in the CTools queue (so Page Manager could use them, if it wanted)
  • Check for a hook_entity_extra_field_info() which could have some things that need special blocks
  • Check for a hook_ENTITY_TYPE_view_alter() for other rendering wierdness we might need to replicate
  • Check the support code in Panelizer for D7 (and CTools for D7, for special blocks) to see if we did anything special there that makes sense in D8 too
  • Add tests

Proposed resolution

Add a 'PanelizerEntity' plugin to provide support for 'user' entities.

Remaining tasks

  • Create the plugin class in src/Plugin/PanelizerEntity/ directory
  • Extend plugin class with base functionality (see src/Plugin/PanelizerEntity/PanelizerNode.php for an example)
  • If the entity has a 'view_builder', look at it's code for anything that makes the entity special see comment #3
  • If this entity needs any special blocks for it's default display, for example, like the 'node links' block, create issues in the CTools queue (so Page Manager could use them, if it wanted)
  • Check for a hook_entity_extra_field_info() which could have some things that need special blocks
  • Check for a hook_ENTITY_TYPE_view_alter() for other rendering wierdness we might need to replicate
  • Check the support code in Panelizer for D7 (and CTools for D7, for special blocks) to see if we did anything special there that makes sense in D8 too

User interface changes

API changes

Data model changes

Comments

dsnopek created an issue. See original summary.

dsnopek’s picture

balsama’s picture

StatusFileSize
new578 bytes
  • [X] Create the plugin class in src/Plugin/PanelizerEntity/ directory
  • [X] See src/Plugin/PanelizerEntity/PanelizerNode.php for an example!
  • [X] If the entity has a 'view_builder', look at it's code for anything that makes the entity special
    • It does not.
  • [ ] If this entity needs any special blocks for it's default display, for example, like the 'node links' block, create issues in the CTools queue (so Page Manager could use them, if it wanted)
    • See next item
  • [ ] Check for a hook_entity_extra_field_info() which could have some things that need special blocks
    • 'User name and password' form - (This doesn't display on the user profile page though)
    • 'Language settings' form - (Same as ^^)
    • 'Member for' - I think this one is legit
  • [ ] Check for a hook_ENTITY_TYPE_view_alter() for other rendering wierdness we might need to replicate
    • Adds a default alt tag to the user_picture field
  • [ ] Check the support code in Panelizer for D7 (and CTools for D7, for special blocks) to see if we did anything special there that makes sense in D8 too

Very simple patch attached that just creates an empty PanelizerUser class. Setting straight to needs work for all of the unchecked items above.

balsama’s picture

Status: Active » Needs work
hctom’s picture

Issue summary: View changes

Use issue template to outline remaining tasks better...

hctom’s picture

Issue summary: View changes
StatusFileSize
new2 KB
new1.85 KB

Here is an updated patch.

What I did:

  • Extend plugin class with base functionality
damienmckenna’s picture

smurrayatwork’s picture

Assigned: Unassigned » smurrayatwork
smurrayatwork’s picture

Updates:

  • Added support for profile images to have their default alt text for accessibility.
  • Created an issue on the CTools Blocks issue queue in order to get a custom block made for the "Member For" time displayed when viewing users. See issue: https://www.drupal.org/node/2846833
damienmckenna’s picture

Status: Needs work » Needs review
damienmckenna’s picture

StatusFileSize
new2.96 KB
new4.78 KB

Working on some tests. Interestingly, the new tests fail locally, but so do the taxonomy term tests.

damienmckenna’s picture

Assigned: smurrayatwork » Unassigned
StatusFileSize
new5.93 KB

Doh, missed the tests file in the patch.

damienmckenna’s picture

Going to get this into beta1 so that the three main entities are officially supported.

  • DamienMcKenna committed 0026830 on 8.x-3.x authored by hctom
    Issue #2664572 by hctom, balsama, smurrayatwork, DamienMcKenna: Support...
damienmckenna’s picture

Status: Needs review » Fixed

Whaddya know, the tests passed! Committed.

Status: Fixed » Closed (fixed)

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