Adding a field programmatically to a content type

Hi,

I want to add a field of type entity_reference with unlimited values (programmatically) to a Content type. Can you please give me some examples? The ones that I found online are not very clear.

Thanks

After installing module, which provides custom entity, entity updates are needed

I have a custom module inside the custom profile and this module provides a new custom content entity, which is translatable. After site installation, the status page says that entity updates are needed for this custom entity and it needs to remove some translation-related fields like author, status, created, changed. If I apply these updates, nothing changes, everything seems to be working. These fields are all marked as translatable in entity class and the logic inside ContentTranslationHandler::getFieldDefinitions() shouldn't apply, although I think maybe it does somehow.

Include PHP Class / Library on Drupal 8

I have a class, and I want to be able to use it on the CMS, not depending on any module, for example because I want to keep it updated by git and use it not only in Drupal projects:

Trouble with the Drupal admin's menus

Hello,

I’m new with Drupal and on this forum.

I just realized that maybe some menus are missing in the admin of my Drupal version.

For example, on my version of the admin/structure/types/page, there is on the top a gray background with the title of the page "Manage  display". Then, just below, there is also a menu on a gray background with the following entries: Edit, Manage fields, Manage form display, Manage display.

screenshot site #1

Drupal 8 + XAMPP on MacOS. Best installation method for full dev use?

Hello there. 

Newcomming to Drupal community, I have chosen Drupal (8.7.5) as the base for getting into deploying web solutions based on CMS for further projects, and really would like to understand architecture of this platform. What is the best way for making a local server on Mac for further different web development?

jsonapi 2.3 post a file always give me errors

I got the following case:
Drupal version: 8.6
jsonapi version: 2.3

now I am trying to POST a binary file (jpg image) to an api as follows:

Headers:

Authorization: bearer xxx
Content-Type: application/octet-stream
Content-Disposition: file; filename="xyz.jpg"
Accept: application/vnd.api+json

and the binary file data.

api url: {{BASE_URL_WITHOUT_TOKENS}}/api/products/deviceModel/110180fd-706e-473c-a362-bb3b7ffcfc31/field_device_model_image

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x