Hello!
I would like to ask a question about were I can find the solution to the issue with my layout with field blocks.
I followed this tutorial: 2 Min Quick Tip - Field Blocks (Backdrop CMS). The existent content shows well, but If I try to edit, the fields are blocked.
If I try to add new content, of the type for which I created the layout, the site goes to a blank page with the message:
Call to a member function bundle() on bool.
Seeing log messages I found:
Error: Call to a member function bundle() on bool en EntityBundleLayoutAccess->checkAccess() (línea 89 de .../core/modules/layout/plugins/access/entity_bundle_layout_access.inc).
Warning: Attempt to read property "nid" on string en EntityIDLayoutAccess->checkAccess() (línea 108 de .../core/modules/layout/plugins/access/entity_id_layout_access.inc)
.
Warning: Attempt to read property "nid" on null en EntityIDLayoutAccess->checkAccess() (línea 108 de .../core/modules/layout/plugins/access/entity_id_layout_access.inc).
Thank you in advance!
Andrés
Comments
Hi Andrés,
Can you please post more details about the layout itself? For example, you could export the layout and post it here.
Also, when you say "If I try to add new content, of the type for which I created the layout, the site goes to a blank page with the message" do you mean that this problem happens AFTER you save the node, or when opening the node form itself?
Hello!
the exported layout is at the bottom. I disabled the layout and the content can be edited using the default layout. The layout configuration is:
If I enable the layout I can't edit the existing content, and when I try to add a new node of type "Trabajo", or also if I try to add any node (.../node/add) I get the mentioned errors and warnings.
Regards, Andrés
{
"_config_name": "layout.layout.trabajo_publicado",
"path": "node/%",
"name": "trabajo_publicado",
"title": "Trabajo publicado",
"description": null,
"renderer_name": "standard",
"module": null,
"weight": -3,
"storage": 1,
"layout_template": "moscone_flipped",
"disabled": true,
"settings": {
"title": "",
"title_display": "default",
"title_block": "41a18de4-5804-4d61-b509-9f1028d908c2",
"paths": []
},
"positions": {
"header": [
"e8faabf1-a261-499d-9e00-fb13331f7e06",
"d12cc418-9804-4bbb-9800-ae94f89e1bf1"
],
"top": [
"41a18de4-5804-4d61-b509-9f1028d908c2",
"a5e55ac3-cc29-42f3-bf03-03381bf64f2e"
],
"content": [
"2e9a4ad0-f23b-4183-8701-1f4fcde0707b",
"e23bd2a8-4656-4a43-9400-df37ae5f7016",
"8432a3c4-dab5-4210-bf00-e0dbd00619f9",
"a6c3a7c7-7e0b-44c7-983d-6114f780091f",
"1a5dc188-f338-44b0-8d00-c35f46ddfd13",
"a69c74d4-ac45-4586-8c03-03770a75ba02",
"74210c09-899f-4871-8b06-6d1300242303"
],
"sidebar": [],
"bottom": [],
"footer": [
"99d8bc06-04df-4ae1-a804-4b62e760b3bf",
"a59ec49c-5538-458e-a934-52589d025629"
],
"title": []
},
"contexts": [],
"relationships": [],
"content": {
"e8faabf1-a261-499d-9e00-fb13331f7e06": {
"plugin": "system:header",
"data": {
"status": 1,
"module": "system",
"delta": "header",
"settings": {
"title_display": "none",
"title": "",
"style": "default",
"block_settings": {
"menu": "",
"logo": 1,
"site_name": 0,
"site_slogan": 1
},
"contexts": [],
"admin_label": "",
"admin_description": ""
},
"uuid": "e8faabf1-a261-499d-9e00-fb13331f7e06",
"style": {
"plugin": "default",
"data": {
"settings": {
"classes": ""
}
}
}
}
},
"d12cc418-9804-4bbb-9800-ae94f89e1bf1": {
"plugin": "system:main-menu",
"data": {
"status": 1,
"module": "system",
"delta": "main-menu",
"settings": {
"title_display": "none",
"title": "",
"style": "default",
"block_settings": {
"menu_name": "main-menu",
"style": "dropdown",
"level": "1",
"depth": "0",
"expand_all": 0,
"clickdown": 0,
"toggle": 1,
"toggle_text": "Menu",
"collapse": "default",
"accordion": 0
},
"contexts": [],
"admin_label": "",
"admin_description": ""
},
"uuid": "d12cc418-9804-4bbb-9800-ae94f89e1bf1",
"style": {
"plugin": "default",
"data": {
"settings": {
"classes": ""
}
}
}
}
},
"41a18de4-5804-4d61-b509-9f1028d908c2": {
"plugin": "system:breadcrumb",
"data": {
"status": 1,
"module": "system",
"delta": "breadcrumb",
"settings": {
"title_display": "default",
"title": "",
"style": "default",
"block_settings": [],
"contexts": []
},
"uuid": "41a18de4-5804-4d61-b509-9f1028d908c2",
"style": {
"plugin": "default",
"data": {
"settings": {
"classes": ""
}
}
}
}
},
"a5e55ac3-cc29-42f3-bf03-03381bf64f2e": {
"plugin": "system:page_components:title",
"data": {
"status": 1,
"module": "system",
"delta": "page_components",
"settings": {
"title_display": "none",
"title": "",
"style": "default",
"block_settings": [],
"contexts": [],
"title_tag": "h3",
"title_classes": "page-title",
"tab_type": "both",
"admin_label": "",
"admin_description": ""
},
"uuid": "a5e55ac3-cc29-42f3-bf03-03381bf64f2e",
"style": {
"plugin": "default",
"data": {
"settings": {
"classes": ""
}
}
}
}
},
"2e9a4ad0-f23b-4183-8701-1f4fcde0707b": {
"plugin": "field:field_block:node-field_autores",
"data": {
"status": 1,
"module": "field",
"delta": "field_block",
"settings": {
"title_display": "none",
"title": "",
"style": "configurable",
"block_settings": [],
"contexts": [],
"label": "above",
"formatter": "text_default",
"formatter_settings": [],
"delta_offset": "0",
"delta_limit": "",
"delta_reversed": 0,
"admin_label": "",
"admin_description": ""
},
"uuid": "2e9a4ad0-f23b-4183-8701-1f4fcde0707b",
"style": {
"plugin": "configurable",
"data": {
"settings": {
"classes": "",
"content_container": 0,
"content_padding": 1,
"color_type": "default",
"background_color": "#ffffff",
"text_color": "#000000",
"padding_top": "0",
"padding_right": "0",
"padding_bottom": "20",
"padding_left": "0",
"height_type": "default",
"height_amount": "500",
"mn_height_amount": "250",
"rel_height_amount": "40",
"mx_height_amount": "500",
"tint": 0,
"tint_value": "0",
"height_unit": "px",
"border_type": "default",
"border_size": "2",
"border_style": "solid",
"border_color": "#000000",
"corner_type": "default",
"corner_size": "8",
"shadow_type": "default",
"shadow_size": "4",
"shadow_color": "#000000"
}
}
}
}
},
"e23bd2a8-4656-4a43-9400-df37ae5f7016": {
"plugin": "field:field_block:node-field_institucion",
"data": {
"status": 1,
"module": "field",
"delta": "field_block",
"settings": {
"title_display": "none",
"title": "",
"style": "configurable",
"block_settings": [],
"contexts": [],
"label": "above",
"formatter": "text_default",
"formatter_settings": [],
"delta_offset": "0",
"delta_limit": "",
"delta_reversed": 0,
"admin_label": "",
"admin_description": ""
},
"uuid": "e23bd2a8-4656-4a43-9400-df37ae5f7016",
"style": {
"plugin": "configurable",
"data": {
"settings": {
"classes": "",
"content_container": 0,
"content_padding": 1,
"color_type": "default",
"background_color": "#ffffff",
"text_color": "#000000",
"padding_top": "0",
"padding_right": "0",
"padding_bottom": "20",
"padding_left": "0",
"height_type": "default",
"height_amount": "500",
"mn_height_amount": "250",
"rel_height_amount": "40",
"mx_height_amount": "500",
"tint": 0,
"tint_value": "0",
"height_unit": "px",
"border_type": "default",
"border_size": "2",
"border_style": "solid",
"border_color": "#000000",
"corner_type": "default",
"corner_size": "8",
"shadow_type": "default",
"shadow_size": "4",
"shadow_color": "#000000"
}
}
}
}
},
"8432a3c4-dab5-4210-bf00-e0dbd00619f9": {
"plugin": "field:field_block:node-field_correo_electronico_del_aut",
"data": {
"status": 1,
"module": "field",
"delta": "field_block",
"settings": {
"title_display": "none",
"title": "",
"style": "default",
"block_settings": [],
"contexts": [],
"label": "above",
"formatter": "email_default",
"formatter_settings": [],
"delta_offset": 0,
"delta_limit": "",
"delta_reversed": 0,
"admin_label": "",
"admin_description": ""
},
"uuid": "8432a3c4-dab5-4210-bf00-e0dbd00619f9",
"style": {
"plugin": "default",
"data": {
"settings": {
"classes": ""
}
}
}
}
},
"a6c3a7c7-7e0b-44c7-983d-6114f780091f": {
"plugin": "field:field_block:node-field_resumen",
"data": {
"status": 1,
"module": "field",
"delta": "field_block",
"settings": {
"title_display": "default",
"title": "",
"style": "default",
"block_settings": [],
"contexts": [],
"label": "hidden",
"formatter": "text_default",
"formatter_settings": [],
"delta_offset": 0,
"delta_limit": "",
"delta_reversed": 0,
"admin_label": "",
"admin_description": ""
},
"uuid": "a6c3a7c7-7e0b-44c7-983d-6114f780091f",
"style": {
"plugin": "default",
"data": {
"settings": {
"classes": ""
}
}
}
}
},
"1a5dc188-f338-44b0-8d00-c35f46ddfd13": {
"plugin": "field:field_block:node-body",
"data": {
"status": 1,
"module": "field",
"delta": "field_block",
"settings": {
"title_display": "none",
"title": "",
"style": "default",
"block_settings": [],
"contexts": [],
"label": "hidden",
"formatter": "text_default",
"formatter_settings": [],
"delta_offset": 0,
"delta_limit": "",
"delta_reversed": 0,
"admin_label": "",
"admin_description": ""
},
"uuid": "1a5dc188-f338-44b0-8d00-c35f46ddfd13",
"style": {
"plugin": "default",
"data": {
"settings": {
"classes": ""
}
}
}
}
},
"a69c74d4-ac45-4586-8c03-03770a75ba02": {
"plugin": "field:field_block:node-field_cone",
"data": {
"status": 1,
"module": "field",
"delta": "field_block",
"settings": {
"title_display": "none",
"title": "",
"style": "configurable",
"block_settings": [],
"contexts": [],
"label": "hidden",
"formatter": "taxonomy_term_reference_link",
"formatter_settings": [],
"delta_offset": 0,
"delta_limit": "",
"delta_reversed": 0,
"admin_label": "",
"admin_description": ""
},
"uuid": "a69c74d4-ac45-4586-8c03-03770a75ba02",
"style": {
"plugin": "configurable",
"data": {
"settings": {
"classes": "",
"content_container": 0,
"content_padding": 1,
"color_type": "default",
"background_color": "#ffffff",
"text_color": "#000000",
"padding_top": "0",
"padding_right": "0",
"padding_bottom": "20",
"padding_left": "0",
"height_type": "default",
"height_amount": "500",
"mn_height_amount": "250",
"rel_height_amount": "40",
"mx_height_amount": "500",
"tint": 0,
"tint_value": "0",
"height_unit": "px",
"border_type": "default",
"border_size": "2",
"border_style": "solid",
"border_color": "#000000",
"corner_type": "default",
"corner_size": "8",
"shadow_type": "default",
"shadow_size": "4",
"shadow_color": "#000000"
}
}
}
}
},
"74210c09-899f-4871-8b06-6d1300242303": {
"plugin": "field:field_block:node-field_area_tematica",
"data": {
"status": 1,
"module": "field",
"delta": "field_block",
"settings": {
"title_display": "none",
"title": "",
"style": "default",
"block_settings": [],
"contexts": [],
"label": "inline",
"formatter": "taxonomy_term_reference_link",
"formatter_settings": [],
"delta_offset": 0,
"delta_limit": "",
"delta_reversed": 0,
"admin_label": "",
"admin_description": ""
},
"uuid": "74210c09-899f-4871-8b06-6d1300242303",
"style": {
"plugin": "default",
"data": {
"settings": {
"classes": ""
}
}
}
}
},
"99d8bc06-04df-4ae1-a804-4b62e760b3bf": {
"plugin": "block:donde_encontrarnos",
"data": {
"status": 1,
"module": "block",
"delta": "donde_encontrarnos",
"settings": {
"title_display": "default",
"style": "default",
"block_settings": {
"delta": "donde_encontrarnos",
"description": "",
"reusable": true
},
"contexts": [],
"title": "",
"admin_label": "",
"admin_description": ""
},
"uuid": "99d8bc06-04df-4ae1-a804-4b62e760b3bf",
"style": {
"plugin": "default",
"data": {
"settings": {
"classes": ""
}
}
}
}
},
"a59ec49c-5538-458e-a934-52589d025629": {
"plugin": "block:nuthost_piedepagina",
"data": {
"status": 1,
"module": "block",
"delta": "nuthost_piedepagina",
"settings": {
"title_display": "none",
"title": "",
"style": "default",
"block_settings": {
"delta": "nuthost_piedepagina",
"description": "",
"reusable": true
},
"contexts": [],
"admin_label": "",
"admin_description": ""
},
"uuid": "a59ec49c-5538-458e-a934-52589d025629",
"style": {
"plugin": "default",
"data": {
"settings": {
"classes": ""
}
}
}
}
}
},
"conditions": [
{
"plugin": "node_type",
"data": {
"settings": {
"bundles": [
"trabajo"
],
"load_condition_nojs": "Load condition"
}
}
}
]
}
Interesting, but I couldn't find "Field blocks" in the list of available modules.
A little off topic, but maybe it will be useful to someone.
For some it's easier to work with layouts, but for me it's easier to work with CSS, I don't like layouts.
If I need to create a unique layout with fields, I use a "Field Group", put the fields in separate containers and use CSS Flex or Grid, including creating options for different screen widths. In my opinion, this is a faster and more correct way.
Hello!
It doesn't require any additional modules. The idea is that if you create a layout with node/% context and visibility condition directed to a node type, the fields of the node type could be placed in different regions of the layout.
I probably need to explore your approach. Could you please tell where I can find more information?
Regards!
Andrés
I doubt that this is described anywhere, but the implementation is extremely simple. Using "Field Group" you create wrappers with custom classes in which fields are placed. CSS is then applied to the parent and these wrappers.
For example, you can create two columns as shown here https://burger.wmetod.ru/menu/burgery/171647894422
.group-node-prod - parent container with display: flex style,
.group-node-prod-l and .group-node-prod-r - left and right group, width: 30% and width: 70%.
This way, you can distribute any number of fields into any number of rows and columns. You can use display: grid, a powerful layout tool.