Questions tagged [entities]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
488 views

Suddenly unable to add a field to a new content type

When editing a content type I was going to add a simple boolean field to an existing content type. When attempting to add the new field Drupal threw an error. After a few more attempts to add a field ...
1
vote
0answers
622 views

How to make a reference to an entity using the uuid of the entity?

Is there any way to make a reference to an entity (using refereces, entity reference or relation) using the uuid of the entity? I'm using features and uuid_features to export the content but ...
0
votes
1answer
430 views

Theming paragraph fields from entity reference in view

I have a view (Drupal 8) where I load my entity reference field (display hidden), with three fields from a Paragraph type and a certain custom display). The HTML markup looks like this now: <div ...
0
votes
1answer
484 views

View displaying field collection items based on taxonomy term

I have a set of nodes that include a field collection item GeoImages. (Each node can contain multiple Geoimages, if that's relevant). Geoimages includes (among other fields) an Image and and Image ...
1
vote
1answer
499 views

How to get the highest value of a specific field in a multivalue field collection

How to get the highest value of a specific field in a multivalue field collection, USING PHP? This is about displaying the right discount for a marketplace product. There is a node type Product with ...
2
votes
2answers
971 views

Load a media entity/object from a fid?

I have the file ID (fid), and the rest of the file object. I need to get fields from the parent media entity, but I can't find anything about loading a media entity from a file object. Drupal 8.4.0 ...
8
votes
4answers
5k views

Get a field instance's settings

What's the equivalent of field_info_instance() for Drupal 8? The default field settings are stored as configuration in a file like field.field.ENTITYTYPE.BUNDLE.FIELDNAME.yml, but how do I get their ...
1
vote
2answers
467 views

How to sort view by a field that is part of a field collection?

I had searched solution for my problem, but I didn’t found anything good. I have custom a node type Client with Field Collection Product. My field collection has two fields: name of the product ...
2
votes
2answers
703 views

Show custom banner per page

Admin user wants to be able to upload image banners and select on which pages/nodes/views/panels to show it when visited (as a wide screen image banner above title). It means when creating the banner ...
2
votes
1answer
343 views

Error : No eligible views were found. Create a view with an Entity Reference display, or add such a display to an existing view

I cannot work out some basic stuff ... what do I not correct? Using D8, distribution varbase. I would like to create a reference from one content type to antoher in D8 so a user is able to use a ...
0
votes
1answer
457 views

Save selected values from a checkbox into a field

I've the next form. $query = "SELECT name, tid FROM taxonomy_term_data WHERE vid=2 AND language = '$language_url';"; $result = db_query($query); foreach ($result as $row2) { $options2[$...
1
vote
1answer
952 views

Profile field create and set default value programmatically

I need the checkbox to be checked by default. Below is my code, notice the 'default_value' under the settings array. $field_instance = array( 'field_name' ...
0
votes
2answers
643 views

Edit a form retrieved using FormBuilder::getForm()

I found out how to get a node creation form, but I want to display and modify it (e.g. delete some fields I don't need). This is my code. public function buildForm(array $form, FormStateInterface $...
-1
votes
0answers
9 views

Store type and Product type permission (add / edit / delete)

Is there any permission on Drupal 8 / Commerce 2 to let admin create,delete or edit store type and product type with Restful endpoints? As you can see in the picture below, there is only (read only) ...
0
votes
0answers
7 views

View showing a list of tagged nodes related to term reference field

Drupal 7 Taxonomy vocabulary = Company activity (Activity 1, Activity 2, Activity 3 ….). This vocabulary has an OG group field. Content type 1 = Company with an entity (terms) reference field ...
5
votes
2answers
3k views

How do I get a list of bundles?

In Drupal 8 how do I programmatically get a list of bundles for an entity type, for example the list of content types. Specifically, I'm looking for the machine names.
0
votes
0answers
35 views

How to render a webform inside Entity form

My drupal system has the user entity with a field webform submission. The system has more than one webform also. What I need is, Whenever a new user came to register, the registration form needs to be ...
1
vote
1answer
490 views

Date with an option for end date being either a date or “ongoing”

I have a content type that contains relevant information of a project. It should hold the projects start date and the end date OR the status "ongoing". How do I make this happen? With the date field ...
0
votes
1answer
429 views

Custom Validation on Address Field

In addition to the validation that already takes place using the addressfield module, I'd like to check for (and fix) items like: Building to Bldg Room to Rm Circle to Cir Avenue to Ave Is there a ...
1
vote
1answer
462 views

Referencing parent entity

I've just started with Drupal and I'm trying to create the following URL structure with PathAuto and Entity Reference: Category A -> Category B -> Category C Resulting in category_a/category_b/...
0
votes
1answer
34 views

How to display date and time picker for base field on custom entity

I've made a base field on a custom entity with type "datetime" using "datetime_default" for the form display. It's displaying as only a date picker, with no time component, whereas I want it to look ...
1
vote
1answer
479 views

problems with entity translation insert hook

I'm using the entity_translation_insert() hook to set the value of a field when a node is translated. I can successfully edit the $entity from within the implementation, but how should I save the ...
3
votes
2answers
496 views

How do I store large volumes or data points using Drupal ( temperature and humidity points )

I'm trying to use Drupal as a headless API, and so far I'm having good results. One of the things I'm collecting is a Temperature and Humidity data. Thus far I've created an entity that can hold the ...
1
vote
1answer
520 views

Alter label with token

I am trying to build a questionnaire that simply replaces (alters) the label of a list-field. I´m doing so by replacing a token from views (embed) and using a hook_alter_form function in an separate ...
1
vote
1answer
625 views

How to properly check in entity form validation if field is empty?

I have a content type "A" (Node entity type). In it's node form (new/edit) I need to check if some fields are empty or not (which are not required in general). My first intention was to use FormState "...
3
votes
1answer
585 views

Webform description allowing HTML

I'd like to allow HTML in my webform field descriptions. I don't need an editor of some sorts; just the basics like and tags and stuff. How can I edit my webform to allow these tags in the ...
0
votes
1answer
467 views

Entity form in ctools modal popup, whilst passing in values from current node

I need to open an entityform in a modal popup. I have got this working using 'Modal operations'‎ and 'Modal forms' modules following this guide: http://julian.pustkuchen.com/en/comment/reply/599. My ...
1
vote
1answer
428 views

How to detect if “Show end date” is checked?

Trying to find a way to get the value of the checkbox "Show end date" on a date field on drupal 7. Is it stored somewhere in the database? Can't find it. Its definitely not in the $node object. Any ...
1
vote
1answer
1k views

Schema.org itemprop=“url” inside anchor object (link)

I'm trying to use the preprocess function to change the default outpot of links <a href> to include Schema.org's itemprop="url" inside the anchor object, as well as adding a <span itemprop="...
0
votes
1answer
494 views

Custom content type which is a check list

I am trying to build a new project in which i as admin can easily add or edit a checklist which is used for tracking a days job which i want any registered user to fill out . This is possible either ...
2
votes
2answers
642 views

Inline entity form shows a content type select list

I am using Inline entity form for a non-commerce project. The settings are:Widget:multiple values,Node:Allow users to add existing content. Mode:Views:Filter by Entity reference view.So I have created ...
47
votes
7answers
40k views

How to change the length of field settings?

I have set once to a website a lenght limit to a field. And now the client wants to put more characters to that field. I cannot change the maximum size from Drupal because I get the following error ...
2
votes
1answer
612 views

'Views Field' issue in NO RESULTS BEHAVIOR - Hide if empty not working

'Hide if empty' configuration of views is not working properly as a result all the empty fields are showing. Is there any work around to force fully hide empty fields in the views result (Page/block) ...
2
votes
1answer
472 views

Arrange formatted fields in Views row using a template

I want to render the rows of my “Recent content” Views page using a template in order to subdivide the rows into multiple divs, freely move around the rendered fields within these divs, and apply ...
3
votes
1answer
645 views

How to add a class to the <a> link elements within a Multiple Values field in a View?

I have a Views field (in this case, taxonomy term references) with Multiple Values set to "Display all values in the same row", using the Link formatter and a seperator. I want to add a class to each "...
1
vote
3answers
2k views

Adding an address to a node's address field programmatically

I am presenting a form to receive an address. I want to take the data and add it to a node that has an address field (from the address field module). Can someone point me in the right direction on ...
2
votes
2answers
1k views

How to check if an entity is referenced before deleting?

Is there a module or a way to use Rules to make sure that a parent node isn't referenced by a child node before deleting the parent? In my case the children require a parent to be created. However ...
2
votes
2answers
5k views

How to import csv file for “field collection” using feed-importers

In Drupal7, In node processor settings -> we can't map field collection values. However they are multiple values, Is there any way of possibilites to import data through CSV file. I tried using field ...
0
votes
1answer
457 views

Show node body fields for entity reference checkboxes widget?

I need to show the body field of the nodes next to their checkboxes in an entity reference field widget (default is just their node titles). Is there a way to do that without writing a new widget?
1
vote
1answer
616 views

How to properly compare values of two identical entities?

I have a custom entity that is not revisionable and I need to store any differences made by the user - and only differences, so if nothing has changed there should be no entry. I am doing this in ...
1
vote
1answer
23 views

Adding a base field definition in an update hook - it's not appearing

I want to add another base field to a Drupal entity. It used to be possible to just change the code for the entity definition and then update it via the Drupal console. But now it has to be done in an ...
1
vote
1answer
511 views

Adding new fields using hook_field_schema_alter()

I have an entity whose field schema is already defined and now I am trying to add couple of fields to it. But I am not sure how to code it up using schema_alter.Below is an example on how I would ...
0
votes
1answer
452 views

How to make relationships between users

I have the quiz module installed on my website. I have setup two user roles on my site, Student and Parents. I want to make a view that shows the results of a parents children. Now I have made two ...
0
votes
2answers
638 views

Entity Reference multi value fields, filter on parent

I have two content types: Family and Members. Family content type has an entity reference field of type Member and can have unlimited values(multiple values). My question is: How to create a view that ...
1
vote
1answer
466 views

default value imagefield -> get from field collection item

I've got a contenttype "gallery" with an imagefield "thumbnail", used in listviews oder teaserviews. This contenttype also has a field collection with "image", "title" and "description". So what would ...
0
votes
1answer
621 views

How to create a parent content type which consists of other child content types?

I want to create custom content type (parent) which consists of other custom content types (children). Is this feasible in Drupal 8? Or I should do it programmatically? Example: I want to have custom ...
1
vote
1answer
612 views

RouteNotFoundException when trying to delete a custom entity

I am building a custom component in Drupal 8 that has an entity with child entities i.e., TeamEntity has one or more MeetEntity objects. When I navigate to the "Delete" link for a given MeetEntity, I ...
1
vote
1answer
552 views

How to set body field display programmatically on node type install?

When hook_installing a new custom node type filled with custom fields I call field_create_instance($instance) where I also set the custom fields' display like so: 'display' => array( 'default' =&...
0
votes
1answer
567 views

View modes are stuck on default view

I had my site for quite some time and just started to use the display suite view modes feature for changing the displays per node. I made new view modes and tried to change them for my nodes, but it ...
1
vote
1answer
521 views

It's a way to select by default N/A checkbox

I want that if a fields is not mandatory the N/A options on select box is ticked by default. I have tried to tick default value N/A on the field but after the setting disappear. I use Drupal 7.15. ...

1 2 3 4 5 169