I have come across a function protected function ContentTypeCreationTrait::createContentType() . But I did not come across any good examples online to create a content type using the function.
I would appreciate if you let me know how to create a content type using a title and machine name of my choice.
I am using the following code to set create a field programmtically and I am trying to set the cardinality as unlimited. But I am getting the error and I cannot add more values.
Hello !
I am new in Drupal world and I'm trying to use the Drupal From API to create a contact form with Ajax validation.
I'm facing an issues:
My following form (see below) works well but only when the user is connected as administrator. When I am not logged in as an administrator, ajax validation does not work.
so $entity->link() is deprecated in the latests versions of drupal 8, that means either it doesn't already work either it won't in a few months. And of course, despite spending hours looking online, I found no clear "new method" to replace it.
Does anyone has an idea ?
Cheers,
'Why try making things simplier when you can make them more complicated ? 'French (joke) proverb.