Inline Formatter Field

Description

This module creates a field type that functions like a boolean field. The widget is a check box for on and off. What makes this field different is that the display is able to be changed through a UI. The default render for the field is a simple html <h1>Hello World!</h1>, but this is able to be edited by users with the permission "edit inline formmater field formats". On the manage display page of an entity, the settings for the field has a text field for what is rendered. Users with the correct permission will have be able to enter any html or twig inside the field. The module allows the use of tokens with the token module.

The settings form for the field that holds the information for what to render uses an editor interface. The ace editor is what is used, and preferences for the editor can be made in the inline formatter field settings form. Settings for whether to use CDNs or downloaded libraries, what theme to use for the editor, what mode the editor should use, whether to wrap lines, and whether to print a margin.

The basic idea of the module is that it can display some rendered code if the authors decide to (they check the box in the node form). There is not a limit to what can be rendered, giving this module a broad use.

One use case could be to set the default value of the field to checked, hide the checkbox in the form display, and the set full output of the node inside the field format. Basically it has the capability of moving the twig template to a UI per entity type.

Project link

https://www.drupal.org/project/inline_formatter_field

Git instructions

git clone --branch 8.x-1.x https://git.drupalcode.org/project/inline_formatter_field.git

Comments

bobbysaul created an issue. See original summary.

avpaderno’s picture

Issue summary: View changes

Thank you for your contribution! I added the Git instructions for non-maintainer users. Users will review the project and report in this issue what needs to be changed.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for your contribution!

Review:
* "$this->t('Render the format for') . ' ' . $field_name;": do not concatenate variables to translatable strings, use placeholders with t() instead.

Otherwise looks good to me, I don't see any security issues.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

bobbysaul’s picture

Thank you everyone for your review! This is very exciting!

Status: Fixed » Closed (fixed)

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