Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Nodes, comments, taxonomy terms, and users, using the terminology used since Drupal 7, are generally called "entities."

0
votes
0answers
40 views

Auto updating entity list [on hold]

How do I make a list of entities that will automatically update when I add a new entity? Like, an invoice of items with form at bottom to add a new item. I havn't made anything yet. Just planning. ...
0
votes
0answers
13 views

Is a form a entityform type? [on hold]

I compared both content with entitieform and without entityform. I tried to load and print the entityform using entity metadata wrapper. Also dsm($form) and dsm($form_state), but I see absolutely no ...
1
vote
0answers
22 views

Add custom fields to an existing entity

I would like to add extra fields to an existing entity WebformSubmission : Assigned to (entity reference to a user) Status ( taxonomy term reference) for these two fields I will need it to be ...
1
vote
0answers
12 views

How do I create field collection of/in another field collection programmatically?

Can anyone please help that how I can create field collection in another field collection using Drupal 7 Entity? The field structure is given below; Content type: Properties - field_1 - field_2 - ...
0
votes
0answers
22 views

How can I get child entities to be created within a node creation form using a custom field widget

I have a decent-sized site in Drupal 7 that I've been working for quite some time to get migrated to Drupal 8. One of my content types is a treasure hunt, and any given treasure hunt can have one or ...
1
vote
0answers
28 views

Is there a way to set the cardinality of a field on a per bundle basis?

I'm creating a bunch of paragraph types with a node entity_reference field, in some cases, I want field_article allow 3 items, in some to allow 5 items and in some to be unlimited. I'd like to set ...
2
votes
1answer
35 views

How to load an entity definition?

I need to load an entity definition to add a constraint and test it, I found that this is possible with the following code: $manager = \Drupal::entityDefinitionUpdateManager(); $entity_definition = $...
0
votes
0answers
24 views

How to get all vocabularies in a taxonomy retrieved from a referenced field?

I have a taxonomy that I am getting in the page twig file after referencing a field from the node object. The twig file is a page for a content type, i.e. page--content-type.html.twig. So node....
0
votes
0answers
28 views

What is the difference between display settings and formatters? [closed]

When it comes to Drupal's Field System What is the difference between display settings and formatters? I'm trying to solving a localization problem and it seems it is not as easy as it should be a ...
0
votes
1answer
21 views

How to add dynamic field labels?

I have a "medical records" content type which has a "medical process" field embedded (type=paragraphs bundle, number of values unlimited). In the paragraph bundle its has visit time, diagnosis, ...
1
vote
1answer
24 views

How to know when a field is a paragraph

I'd like to know when a field from a node it's a paragraph, I only get the type, that it's entity_reference_revisions, I use this method to get the information: \Drupal\field\Entity\...
0
votes
1answer
90 views

How to group view by field and display row results below?

We have a content type Basic Page that is supposed to be grouped by a taxonomy term field Page Type that has the following values below in a view. How can we setup the view so that the view will ...
0
votes
1answer
29 views

Getting Node Field Values from Referenced Entity within a Paragraph

I'm trying to create a featured content paragraph type, however, I can't figure out how to grab anything from the referenced node that is in my entity reference. I don't see any twig documentation ...
0
votes
1answer
27 views

Can't add instance of custom field type to entity

I have a custom field type that I'm trying to add to a custom fieldable entity. The entity works fine and I've added other fields to it, my problem is when I go to add an instance of my field to the ...
6
votes
1answer
91 views

How to add taxonomy term reference field in a custom form

In the previous version of Drupal, it was possible to reference taxonomy tags in Drupal's forms using the following option: '#autocomplete_path' => 'taxonomy/autocomplete/'.$vid, However, in the ...
0
votes
0answers
57 views

Entity Reference Field when logged out

I have an Entity Reference Field attached to a Content Type. This field references Views, and has a field format of Entity ID When I am logged in, the field appears fine, however it does not appear ...
1
vote
0answers
23 views

How to create content of content type which is a reference to a paragraph?

I want to add a content to content type (ct1) which has only one field (f1) which is a reference to a paragraph (p1), said paragraph has 4 fields: 3 numeric fields (1, 2, 3) and entity reference (er1) ...
0
votes
1answer
52 views

How to save a checkbox config_object in the schema files?

We have a custom module with the following files. It is mainly used to store a list of content types that this configuration applies to. When saving the configuration, we get the following code. How ...
0
votes
0answers
15 views

How to add currency field?

With respect to the question, can anyone suggest a remedy for the same. How can I create a field for currency(with selecting currency and text field to enter the amount) considering the fact that ...
0
votes
1answer
19 views

Adding HTML class attributes to Entity Reference field links in View

I have a view ("Tasks") that pulls in Task nodes, complete with sorting and filtering. Each Task can have multiple nodes attached via the "Related Articles" field (field_related_articles). I am trying ...
0
votes
1answer
61 views

Custom form to modify only some fields of an EntityForm

I generated an Entity following this guide. Now I would like to create a custom form to modify only some fields inside a single entity. I was thinking to create an action inside the controller calling ...
2
votes
2answers
87 views

Display a Media Entity Image from other (referencing) node in a Twig template

Seems that all found in the Internet does not work for my case. :/ In general, I need to display an Image and a Project, referenced by the node that has a reference field to my node. I have: a node ...
0
votes
0answers
26 views

EFQ with huge data

I'm using EFQ to load nodes. However when the data is huge the page naturally breaks. Is there a way to lazy load the EFQ result or any idea how to optimize it? Noting that the client doesn't want ...
0
votes
0answers
13 views

Field link to reference another view mode

How do i add a link field to Drupal 8 entity and reference another display mode? Say: on the default display mode, i don't want the user to see all the information but to click on a link for either a ...
0
votes
1answer
11 views

Entityreference not saved correctly inside ContentEntityForm

I was having a weird bug with my views. Some entity-references from my main-entity didn't show up in my view. I investigated further with entityQuery and came across some weird action. I can get the ...
0
votes
1answer
8 views

Clone Commerce Product Option Sets

This issue hints it's possible to clone Option sets https://www.drupal.org/project/commerce_option/issues/1319618 To reproduce: On page admin/commerce/products/option-sets Click 'clone' on any ...
0
votes
0answers
48 views

How to fetch field revision history for each change, username, created and delta value?

I would like to fetch and display the revision history for each change for each field attached to an entity. I notice in each field revision table the username and created are not there. Only the ...
3
votes
1answer
102 views

When to create schema while working with config entity?

We have a custom form mymoduleForm.php that is used to perform some logic by calling mymodule_preprocess_node(). We were able to add addCacheableDependency() and now the mymodule_preprocess_node hook ...
0
votes
0answers
21 views

Is there any way to auto generate an entity reference (behind the scenes) using only the entity ID?

I'm looking for some help with my workflow on my Drupal 7 website... Currently: 2 user types ( user type 1: u1, user type 2: u2 ) u1 creates content u2 creates a product referencing u1's content u1 ...
0
votes
1answer
27 views

How to get all the field and value of node as an array? [closed]

I am trying to render all field and value of a node as an array dynamically. How can i achieve that?
0
votes
1answer
26 views

URL Pattern in node entity reference

I have a content type A, which contains an entity reference field. That field references a content type B. I have create automatic URL paths for both content types. When I create a new node of type A,...
-1
votes
0answers
16 views

How to embed media in Drupal Commons

Using Drupal Commons-7.x-3.46.. I'd like to allow users to embed media in a post just by pasting a link into the body of a post, i.e. without buttons or widgets. This seems to have become quite ...
0
votes
0answers
17 views

How do I create a custom field/module with both Image field and HTML field?

I want to create a custom field that allows a user to upload image along with some HTML code. In the image above, I want the 'Enter the blocks' area to be a CKeditor/HTML field. The issue I'm ...
0
votes
1answer
14 views

Field help text is printed as input field title, not in separate field

On Bootstrap theme add field Text, give it any Help text, save it and you get empty field, but if you hover on the field it shows the help text on mouse tooltip. But if you e.g. make list field (text)...
0
votes
3answers
18 views

How to add content inbetween node fields on node creation?

I have a node called survey. Inbetween fields I want arbitrary text. The text is not associated with a field. I tried adding a "group", but could not find a way to add html. Then I looked at adding ...
1
vote
1answer
116 views

How to clear cache for config entity after making changes?

We have a custom form mymoduleForm that has mymodule.settings which stores some values that we need to run some logic when calling mymodule_preprocess_node() hook. The form just has a text area where ...
0
votes
1answer
16 views

How to access the existing field value in a custom field?

I have a content type which shows video in iframe from youtube. There is a field which I can enter the youtube link and it will render the iframe using the link. I have created a custom field which ...
0
votes
1answer
34 views

How to get parent node values on inline entity form hook alter?

I am using inline entity forms to create a paragraph in a node form. When I add a node I want the title of the node form to be copied to the paragraph when I click on "Add paragraph". I use ...
0
votes
0answers
13 views

Permission for Add more/Delete button for entity reference field

In my Drupal 7 Project, I want to know how can I define permissions for Add more/delete buttons and submission form for specific rules? For example users with role A are not able to see add more/...
0
votes
0answers
8 views

Saving value from computed field without array for language and cardinality

Using a computed field, I grab the value of the commerce SKU field, alter it and want to safe it. I am using varchar and my computed PHP code looks like this: $entity_field[0]['value'] = str_replace('...
2
votes
1answer
134 views

Entity queue JSONAPI pagination & How to add JSON API in views?

I'm using below modules https://www.drupal.org/project/entityqueue & JSON API Through entity queue. I have added 5 Articles. Now I would like to apply pagination on that. We are accessing via ...
0
votes
2answers
34 views

Permission issues with Custom Content Entity exposed to REST API

I hope it's not a duplicate entry. I've recently created my Custom Content Entity within a Custom module and I'm currently having trouble with permissions. (Please see permissions below) The ...
-1
votes
1answer
40 views

How to assign programatically a field to a paragraph bundle

I'm developing a module to extend paragraphs module. The idea is that the users can assign a description field to paragraphs bundles. I have create a module, and also I have create the file field....
0
votes
0answers
9 views

Views Field Ovveride - Twig Conditional

I try to use a twig conditional to check the value of a field in the custom text box for that field when I use the views UI Here is my code: {% set checkTime = "10" %} {% set confirm = "10 exists in ...
3
votes
3answers
63 views

When to use a new field on the user account or a custom table and when use user.data service?

Is there any rule when to use a new field in the user account for storing information and when to use the user.data service? My initial approach was: When the information should be editable either by ...
0
votes
0answers
8 views

Combine two views result with entity reference

I have three content type: Chart of Accounts (node: Electricity, Accountant Payable etc.) Expense Payment When I create "expense content" I reference Chart of Account (node: Accountant Payable) by ...
0
votes
0answers
9 views

Add checkboxes to nodes rendered from an entity field query

I have a content type which shows a list of other nodes connected via an entity reference field. These nodes are loaded through an entity field query in a preprocess_node module, then displayed using ...
0
votes
0answers
11 views

Why does this entity form when saved create a new instance rather than save the present one

This may be a question which only the most familiar with the module EntityForm can help with. My situation is this. I have a content type called project and each node has an entity form attached to ...
0
votes
1answer
20 views

How to force the allowed number of values of a custom field to 1

I'm creating a custom field. How do I force the number of values to 1? All the answers I find are for Drupal 7.
0
votes
0answers
25 views

How to query for field entites

I want to search in a particular field by field instances, not related nodes. There should be a row of results for every matching field, that's why I'm not using an entity field query and searching by ...