Add API documentation.

See the documentation in the process plugins for format examples.

CommentFileSizeAuthor
#5 2862751-5.patch1.72 KBjofitz
#5 interdiff-2-5.txt1.48 KBjofitz
#2 2862751-2.patch1.58 KBjofitz

Comments

quietone created an issue. See original summary.

jofitz’s picture

Status: Active » Needs review
StatusFileSize
new1.58 KB

Added the configuration keys and an example.

phenaproxima’s picture

Assigned: Unassigned » phenaproxima

Self-assigning for review.

phenaproxima’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityDisplay.php
    @@ -5,6 +5,44 @@
    + * Available configuration keys:
    + * - entity_type: The entity type.
    + * - bundle: The entity bundle.
    + * - view_mode: The view mode.
    + * - field_name: The name of the field.
    + * - options: The display options.
    

    These aren't configuration keys, they're the destination properties expected in the imported row. I think we'll need to rephrase this again. Also, the property descriptions are a bit threadbare. It's not clear, for example, if entity_type is supposed to be a string. I'd suggest the following:

    entity_type: The entity type ID.
    bundle: The entity bundle.
    view_mode: The machine name of the view mode.
    field_name: The machine name of the field to be imported into the display.
    options: (optional) An array of options for displaying the field in this view mode.

  2. +++ b/core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityDisplay.php
    @@ -5,6 +5,44 @@
    + * This will create a "user_picture" image field on the "default" view mode of
    

    It's misleading to say that a field is created. How about "This will add the user_picture image field to the default view mode of user entities, with options defined by the 'options' constant (i.e., the label will be hidden, no image style will be applied, etc.)"

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new1.48 KB
new1.72 KB

Made the changes suggested by @phenaproxima in #4.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Looks terrific!

  • Gábor Hojtsy committed 3e9c8b0 on 8.3.x
    Issue #2862751 by Jo Fitzgerald, phenaproxima: Add documentation to...

  • Gábor Hojtsy committed 2afd387 on 8.4.x
    Issue #2862751 by Jo Fitzgerald, phenaproxima: Add documentation to...
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Baltimore2017

Superb, thanks, looks good, committed.

Status: Fixed » Closed (fixed)

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