Hi, editing the layout of a content type under /admin/structure/types/manage/event/display/default/layout is hard with viewfield - because the viewfield output is invisible while editing. Please, see screenshot.
(The field works correctly on nodes, though)

The output of a working entity reference field:

<div data-layout-content-preview-placeholder-label="&quot;Related Events&quot; field" class="js-layout-builder-block layout-builder-block contextual-region clearfix block block-layout-builder block-field-blocknodeeventfield-related-events" data-layout-block-uuid="848bb84c-dbd2-46e4-b2df-690f936dd963" data-layout-builder-highlight-id="848bb84c-dbd2-46e4-b2df-690f936dd963">
  
    <div data-contextual-id="layout_builder_block:section_storage_type=defaults&amp;section_storage=node.event.default&amp;delta=1&amp;region=first&amp;uuid=848bb84c-dbd2-46e4-b2df-690f936dd963:operations=move%3Aupdate%3Aremove&amp;langcode=en" data-contextual-token="Sr-gNLxSkerAqVRz7D8C1SCyOQUwPr9lKAWL8x-USqM" class="contextual"><button class="trigger focusable visually-hidden" type="button" aria-pressed="false">Open  configuration options</button><ul class="contextual-links" hidden=""><li class="layout-builder-block-update"><a href="/layout_builder/update/block/defaults/node.event.default/1/first/848bb84c-dbd2-46e4-b2df-690f936dd963?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Configure</a></li><li class="layout-builder-block-move"><a href="/layout_builder/move/block/defaults/node.event.default/1/first/848bb84c-dbd2-46e4-b2df-690f936dd963?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Move</a></li><li class="layout-builder-block-remove"><a href="/layout_builder/remove/block/defaults/node.event.default/1/first/848bb84c-dbd2-46e4-b2df-690f936dd963?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Remove block</a></li></ul></div>
      <div class="content">
        <div class="field field--name-field-related-events field--type-entity-reference field--label-above field--entity-reference-target-type-node clearfix">
    <div class="field__label">Related Events</div>
          <div class="field__items">
              <div class="field__item"><a href="/klient/karme/events/595" hreflang="en" tabindex="-1">PM-Management</a></div>
              </div>
      </div>

    </div>
  </div>

The output of the viewfield seems incomplete:

<div data-layout-content-preview-placeholder-label="&quot;Relating Events&quot; field" class="js-layout-builder-block layout-builder-block contextual-region clearfix block block-layout-builder block-field-blocknodeeventfield-relating-events" data-layout-block-uuid="26c37294-5328-4d8c-b6b4-97d52d279021" data-layout-builder-highlight-id="26c37294-5328-4d8c-b6b4-97d52d279021">
  
    <div data-contextual-id="layout_builder_block:section_storage_type=defaults&amp;section_storage=node.event.default&amp;delta=1&amp;region=first&amp;uuid=26c37294-5328-4d8c-b6b4-97d52d279021:operations=move%3Aupdate%3Aremove&amp;langcode=en" data-contextual-token="2uvIgRUdu1j16FHNkn70Fx8uTiKGkjCdi473XiX0USI" class="contextual"><button class="trigger visually-hidden focusable" type="button" aria-pressed="false">Open  configuration options</button><ul class="contextual-links" hidden=""><li class="layout-builder-block-update"><a href="/layout_builder/update/block/defaults/node.event.default/1/first/26c37294-5328-4d8c-b6b4-97d52d279021?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Configure</a></li><li class="layout-builder-block-move"><a href="/layout_builder/move/block/defaults/node.event.default/1/first/26c37294-5328-4d8c-b6b4-97d52d279021?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Move</a></li><li class="layout-builder-block-remove"><a href="/layout_builder/remove/block/defaults/node.event.default/1/first/26c37294-5328-4d8c-b6b4-97d52d279021?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Remove block</a></li></ul></div>
      <div class="content">
      
	  <div class="field field--name-field-relating-events field--type-viewfield field--label-">
  
      <div class="field__label"></div>
    
      </div>

    </div>
  </div>

Here is a comparison:

--- C:/tmp/reference.txt	Mi. Apr 15 11:34:47 2020
+++ C:/tmp/viewfield.txt	Mi. Apr 15 11:34:32 2020
@@ -1 +1 @@
-<div data-layout-content-preview-placeholder-label="&quot;Related Events&quot; field" class="js-layout-builder-block layout-builder-block contextual-region clearfix block block-layout-builder block-field-blocknodeeventfield-related-events" data-layout-block-uuid="848bb84c-dbd2-46e4-b2df-690f936dd963" data-layout-builder-highlight-id="848bb84c-dbd2-46e4-b2df-690f936dd963">
+<div data-layout-content-preview-placeholder-label="&quot;Relating Events&quot; field" class="js-layout-builder-block layout-builder-block contextual-region clearfix block block-layout-builder block-field-blocknodeeventfield-relating-events" data-layout-block-uuid="26c37294-5328-4d8c-b6b4-97d52d279021" data-layout-builder-highlight-id="26c37294-5328-4d8c-b6b4-97d52d279021">
@@ -3 +3 @@
-    <div data-contextual-id="layout_builder_block:section_storage_type=defaults&amp;section_storage=node.event.default&amp;delta=1&amp;region=first&amp;uuid=848bb84c-dbd2-46e4-b2df-690f936dd963:operations=move%3Aupdate%3Aremove&amp;langcode=en" data-contextual-token="Sr-gNLxSkerAqVRz7D8C1SCyOQUwPr9lKAWL8x-USqM" class="contextual"><button class="trigger focusable visually-hidden" type="button" aria-pressed="false">Open  configuration options</button><ul class="contextual-links" hidden=""><li class="layout-builder-block-update"><a href="/layout_builder/update/block/defaults/node.event.default/1/first/848bb84c-dbd2-46e4-b2df-690f936dd963?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Configure</a></li><li class="layout-builder-block-move"><a href="/layout_builder/move/block/defaults/node.event.default/1/first/848bb84c-dbd2-46e4-b2df-690f936dd963?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Move</a></li><li class="layout-builder-block-remove"><a href="/layout_builder/remove/block/defaults/node.event.default/1/first/848bb84c-dbd2-46e4-b2df-690f936dd963?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Remove block</a></li></ul></div>
+    <div data-contextual-id="layout_builder_block:section_storage_type=defaults&amp;section_storage=node.event.default&amp;delta=1&amp;region=first&amp;uuid=26c37294-5328-4d8c-b6b4-97d52d279021:operations=move%3Aupdate%3Aremove&amp;langcode=en" data-contextual-token="2uvIgRUdu1j16FHNkn70Fx8uTiKGkjCdi473XiX0USI" class="contextual"><button class="trigger visually-hidden focusable" type="button" aria-pressed="false">Open  configuration options</button><ul class="contextual-links" hidden=""><li class="layout-builder-block-update"><a href="/layout_builder/update/block/defaults/node.event.default/1/first/26c37294-5328-4d8c-b6b4-97d52d279021?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Configure</a></li><li class="layout-builder-block-move"><a href="/layout_builder/move/block/defaults/node.event.default/1/first/26c37294-5328-4d8c-b6b4-97d52d279021?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Move</a></li><li class="layout-builder-block-remove"><a href="/layout_builder/remove/block/defaults/node.event.default/1/first/26c37294-5328-4d8c-b6b4-97d52d279021?destination=/admin/structure/types/manage/event/display/default/layout" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas">Remove block</a></li></ul></div>
@@ -5,5 +5,5 @@
-        <div class="field field--name-field-related-events field--type-entity-reference field--label-above field--entity-reference-target-type-node clearfix">
-    <div class="field__label">Related Events</div>
-          <div class="field__items">
-              <div class="field__item"><a href="/klient/karme/events/595" hreflang="en" tabindex="-1">PM-Management</a></div>
-              </div>
+      
+	  <div class="field field--name-field-relating-events field--type-viewfield field--label-">
+  
+      <div class="field__label"></div>
+    
@@ -13,3 +13 @@
-  </div>
-  
-  
+  </div>

Where the essential difference is :

Working entity reference field:

      <div class="content">
        <div class="field field--name-field-related-events field--type-entity-reference field--label-above field--entity-reference-target-type-node clearfix">
    <div class="field__label">Related Events</div>
          <div class="field__items">
              <div class="field__item"><a href="/klient/karme/events/595" hreflang="en" tabindex="-1">PM-Management</a></div>
              </div>
      </div>

And the output of the invisible viewfield:

      <div class="content">
      
	  <div class="field field--name-field-relating-events field--type-viewfield field--label-">
  
      <div class="field__label"></div>
    
      </div>

Hope this helps - Viewfield is one of the most important modules!

CommentFileSizeAuthor
2020-04-15_11h38_29.png37.23 KBmaxilein
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

maxilein created an issue. See original summary.

maxilein’s picture

Using D 8.8.5

jerdavis’s picture

I'm unable to reproduce this. On 8.8.5 with current code from Viewfield 8.x-3.x branch, the view output is rendering in Layout Builder when editing the layout on an individual node. In the content type default layout it shows as a placeholder.

What version of Viewfield are you using?

jerdavis’s picture

Status: Active » Postponed (maintainer needs more info)
maxilein’s picture

8.x-3.0-beta5

I'm editing in the content type default.
What else could I try to get you more info?

Maybe this:
I have two viewfields there. One is rendering fine. The other as laid out here.

Maybe the view does not get the nid passed as a parameter? Then it would be empty, but it should be shown as a proper placeholder...

jerdavis’s picture

Can you provide screenshots of the field configurations and the full screen where this issue is occuring?

maxilein’s picture

I will. asap. R