Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey,
I currently struggling to get quickedit to work with single fields printed out inside my twig template.
For testing proposal I am using the node.html.twig template from the classy theme and modified it a bit:
<article {{ attributes.addClass(classes) }}>
{{ title_prefix }}
{% if not page %}
<h2{{ title_attributes }}>
<a href="{{ url }}" rel="bookmark">{{ label }}</a>
</h2>
{% endif %}
{{ title_suffix }}
{% if display_submitted %}
<footer class="node__meta">
{{ author_picture }}
<div{{ author_attributes.addClass('node__submitted') }}>
{% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
{{ metadata }}
</div>
</footer>
{% endif %}
<div{{ content_attributes.addClass('node__content') }}>
{{ content }}
</br>
{{content.field_teaser_text}}
</br>
{{content.field_teaser_button_text}}
</div>
</article>
Quickedit is working fine for everything that is printed out by {{ content }} but it is not working for the two fields below it.
This is a the markup from a field printed by {{ content }}:
<div data-quickedit-field-id="node/21/field_teaser_text/de/full" class="clearfix text-formatted field field--name-field-teaser-text field--type-text-long field--label-hidden field-wysiwyg field__item quickedit-field"><p>Ich bin dein Teaser text</p>
</div>
And this is the markup created when i print just the field:
<div data-quickedit-field-id="node/21/field_teaser_text/de/full" class="clearfix text-formatted field field--name-field-teaser-text field--type-text-long field--label-hidden field-wysiwyg field__item quickedit-field"><p>Ich bin dein Teaser text</p>
</div>
So pretty much the same, but just not working :-/
Any hint how to get it working for single fields?
Greetings
sgurlt
Comments
Comment #2
Wim LeersThose are not "pretty much the same", they're identical. Did you make a mistake in the copy/pasting perhaps?
What exactly is breaking? Please record a screencast.
Comment #3
Wim LeersClosing due to lack of response. Feel free to reopen :)
Comment #4
Wim Leers