Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 60010

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

3 votes
2 answers
2k views

Allowed types for DataDefinition::create()

I'm creating a new Field Type in Drupal 8. What types can I pass to DataDefinition::create()?
Andrea's user avatar
  • 1,267
0 votes
1 answer
85 views

Allowed column type names and element type names for creating custom Field Types

I'm creating new Field Types in Drupal 8. I recently asked which are the type names allowed for the DataDefinition::create() method, receiving a good answer. Now I figured out that I need at least o …
Andrea's user avatar
  • 1,267
2 votes
1 answer
988 views

Getting an error adding a new field with a custom Field Type

I defined a new Field Type named country following this nice tutorial: http://capgemini.github.io/drupal/writing-custom-fields-in-drupal-8/ These are main files from the country custom Field Type: m …
Andrea's user avatar
  • 1,267
0 votes
1 answer
2k views

How do I change the edit form layout for a custom field type

I created an Address custom field type, with two text fields (street and city). When I add a new Address field on a content type, I get this form inside the edit page. How can I change the layout …
Andrea's user avatar
  • 1,267
1 vote
1 answer
4k views

How to add an image upload field in a custom Field Type

I'm defining a new custom Field Type in Drupal 8, let's say MyFieldType, with custom widget and formatter also. Such Field Type should have these two fields: text: a simple text value image: a fiel …
Andrea's user avatar
  • 1,267
0 votes
1 answer
181 views

Getting fields' Attributes in node template

I'm trying to rendering node's fields directly inside a node template. This is my node template file node--homepage.twig.html: <div{{ attributes }}> {{ title_prefix }} {{ title_suffix }} <div{ …
Andrea's user avatar
  • 1,267
0 votes
1 answer
365 views

Retriving nodes by content type using Drupal::entityQuery

I created a content type named product. How can I retrive all node of such content type using the entityQuery method? I tried with this, but it doesn't works: $ids = \Drupal::entityQuery('product') …
Andrea's user avatar
  • 1,267
1 vote
Accepted

Retriving nodes by content type using Drupal::entityQuery

This is how we do this: $ids = \Drupal::entityQuery('node') ->condition('type', 'product') ->execute(); $products = \Drupal::entityManager() ->getStorage('node') ->loadMultiple($ids);
Andrea's user avatar
  • 1,267