Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

An Overview of Field Collection Views Module

65 vues

Publié le

In this short presentation, Ahana Kundu of Valuebound has provided “An Overview of Field Collection Views Module”. The slide also contains a brief note on why do we need this module? And how to create such a module along with the demo.

Publié dans : Technologie
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

An Overview of Field Collection Views Module

  1. 1. An Overview of Field Collection Views Module Ahana Kundu www.drupal.org/u/ahana92
  2. 2. ● Brief About Field Collection Module ● Why Do We Need Field Collection Views Module ● Making of the module ● Demo Agenda
  3. 3. ● The field collection module helps in grouping a few fields together and represent it as one field in the content type. Why do we use the field collection module?
  4. 4. ● The field collection views module helps in showing the field collection related data in a table format. Why do we need the field_collection_views module?
  5. 5. field_collection_views.info.yml name: Field Collection views type: module description: Provides a field-collection views formatter. core: 8.x dependencies: - drupal:field_collection Making of the Module
  6. 6. The field formatter formats the field data to be viewed by the end user. Field formatters are defined as plugins. module->src->Plugin->Field->FieldFormatter- >FieldCollectionViewsFormatter.php Field Formatter
  7. 7. * Plugin implementation of the * 'views_field_collection_items' formatter. * * @FieldFormatter( * id = "views_field_collection_items", * label = @Translation("Views field-collection items"), * field_types = { * "field_collection" * } * ) */ Field Formatter
  8. 8. public static function defaultSettings() { return [ 'name' => 'field_collection_view', 'display_id' => 'default', 'add' => t('Add'), ] + parent::defaultSettings(); } Field Formatter Default Settings
  9. 9. public function settingsForm(array $form, FormStateInterface $form_state) { $element['name'] = [ '#type' => 'textfield', '#title' => t('Name'), '#default_value' => $this->getSetting('name'), '#description' => t('The machine name of the view to embed.'), ]; } Field Formatter Settings Form
  10. 10. Demo
  11. 11. Thank you

×