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.

This module provides a simple way for themers to remove outer divs from fields directly from Manage display formatter settings.
You only have to override field.html.twig and you can have surrounding field divs for one field in one display and remove them in another display. No other field template override is required.

Installation

Install this module normally, just like you would install a contributed Drupal module. Visit https://www.drupal.org/node/1897420 for further information.

If you don't have one, create a custom theme (https://www.drupal.org/docs/theming-drupal).

Copy field.html.twig from drupal core (web/core/modules/system/templates/field.html.twig) or from the parent theme or your theme.

Use the code following code snippet to have both stripped or normal DOM version :

{% if stripouter_valueonly %}:

  {% for item in items %}
    {{ item.content }}
  {% endfor %}

{% else %}

  <!-- content from field.html.twig -->

{% endif %}

Clear your cache.

Go to your content type "Manage display" tab and edit your field display setting to control DOM output for one view mode or another.

Other modules :

Please consider using No Markup module first as it have more installations.

We still continue to maintain this module.

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.0 Stable Oct 17, 2023