Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

simplenews render flow

No security coverage

Part of the Simplenews ecosystem · 7 projects

View on drupal.org
This module adds a button in content type's specific layout builder to dump default rendered layout to
the same node html field.
The target field will be based on what's defined in node type settings(section workflow).
There you could choose any text_long to dump the specified view mode result. By now only Full view
mode can be choosen, because when using layout builder only the Full view mode allows each content
item to have its layout customized, this restriction may change when https://www.drupal.org/project/drupal/issues/2907413
is fixed.

Solving the FULL view mode waste
Because of the above restriction, Full view mode will always show the 'live' build of the content, e.g. that
means that if layout builder specifies the use of dynamic views it will contain the recent content. This could
be solved using a block that renders only the defined render field, and allowing the visualization of the
block only if content type is simplenews. This block is included in this module it's up to you to place it
where is needed and also find other ways to hide the original Full view mode content, for example using css.

Configure the simplenews render flow

Create a text_long field in content used as simplenews.
Define the render field which will be the target of the html dump in /admin/structure/types/manage/your_simplenews_bundle . Only Full view mode can be selected by now.
Edit the view modes Email: HTML and maybe Email: Plain to show only the defined render field.
If you plan to use Layout Builder(recommended) in /admin/structure/types/manage/your_simplenews_bundle/display/default check Use Layout Builder (and maybe Allow each content item to have its layout customized).
Edit the simplenews content type default layout for Full view mode (or default if Full is not overriden) in /admin/structure/types/manage/your_simplenews_bundle/display/default pressing manage layout button.
Note that when defining the Layout builder contents DO NOT add the render field to avoid render build loops that
will exhaust your machine memory.


Defining simplenews layout or contents
After setting, for all bundle, or for every content item if choosen, one can build its layout.
With the Layout builder you could control how a newsletter is displayed and which content must get in. When you
are sure it's fine press the Render to html field button, it will output this layout to defined target field
and the content of this field will be used as newsletter item content.
The result will be used as send and archive contents. The render output without site other sections such
as header, sidebars, footers... that can be used as archive will be shown at mail preview tab.
If the workaround explained in solving the FULL view mode waste section is
used, canonical url of the content such as https://example.org/node/{nid} could be used to show the render
field, the live layout or both.
TODO:

choose the layout to be used to dump (if feature in https://www.drupal.org/project/drupal/issues/2907413 is fixed).

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Oct 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
1.0.x-dev Dev Oct 11, 2023