Chris@0: /und/-" Chris@0: * After the editing is complete, this hook is invoked on the module with Chris@0: * the custom render pipeline identifier (last part of data-edit-field-id) to Chris@0: * re-render the field. Use the same logic used when rendering the field for Chris@0: * the original display. Chris@0: * Chris@0: * The implementation should take care of invoking the prepare_view steps. It Chris@0: * should also respect field access permissions. Chris@0: * Chris@0: * @param \Drupal\Core\Entity\EntityInterface $entity Chris@0: * The entity containing the field to display. Chris@0: * @param string $field_name Chris@0: * The name of the field to display. Chris@0: * @param string $view_mode_id Chris@0: * View mode ID for the custom render pipeline this field view was destined Chris@0: * for. This is not a regular view mode ID for the Entity/Field API render Chris@0: * pipeline and is provided by the renderer module instead. An example could Chris@0: * be Views' render pipeline. In the example of Views, the view mode ID would Chris@0: * probably contain the View's ID, display and the row index. Views would Chris@0: * know the internal structure of this ID. The only structure imposed on this Chris@0: * ID is that it contains dash separated values and the first value is the Chris@0: * module name. Only that module's hook implementation will be invoked. Eg. Chris@0: * 'views-...-...'. Chris@0: * @param string $langcode Chris@0: * (Optional) The language code the field values are to be shown in. Chris@0: * Chris@0: * @return Chris@0: * A renderable array for the field value. Chris@0: * Chris@0: * @see \Drupal\Core\Field\FieldItemListInterface::view() Chris@0: */ Chris@0: function hook_quickedit_render_field(Drupal\Core\Entity\EntityInterface $entity, $field_name, $view_mode_id, $langcode) { Chris@0: return [ Chris@0: '#prefix' => '
', Chris@0: 'field' => $entity->getTranslation($langcode)->get($field_name)->view($view_mode_id), Chris@0: '#suffix' => '
', Chris@0: ]; Chris@0: } Chris@0: Chris@0: /** Chris@0: * @} End of "addtogroup hooks". Chris@0: */