Add the lpb field formatter for frontend (experimental) editing too

Created on 10 December 2024, 29 days ago

As you implemented the override for the form field widget, it is also possible to override the experimental Field formatter builder. This can easily done using the same implementation you did :

the Class located in the folder Plugin\Field\FieldWidget would looks like this :

<?php

namespace Drupal\lpb\Plugin\Field\FieldFormatter;

use Drupal\layout_paragraphs\Plugin\Field\FieldFormatter\LayoutParagraphsBuilderFormatter;
use Drupal\paragraphs_browser\Plugin\Field\FieldWidget\ParagraphsBrowserWidgetTrait;

/**
* Happy Layout Paragraphs field formatter.
*
* @FieldFormatter(
* id = "lpb_layout_paragraphs_builder",
* label = @Translation("Layout Paragraphs Builder using paragraphs browser (Experimental)"),
* description = @Translation("Renders editable paragraphs with layout and using paragraphs browser."),
* field_types = {
* "entity_reference_revisions"
* }
* )
*/
class LpbLayoutParagraphsBuilderFormatter extends LayoutParagraphsBuilderFormatter {
use ParagraphsBrowserWidgetTrait;
}

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇨🇭Switzerland grumpy74 Geneva, CH 🇨🇭

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024