I've used Drupal Console to generate an entity type (Groups), so far so good, I've also added some bundles to this entity type on install through config (Group 1, Group 2, group 3).
What I want to be able to do is add additional default twig files for each of the bundles for the view add, edit pages etc.. from within my module.
Can anyone give me an example please of what I would need to change in my code to get that granular as I haven't figured it out from the reading I have been doing
I've a custom field to add an image. This field work fine, but after X hours this image disappears...
After search, I've found that image is only save temporarily.
I've made this script to make image permanent.
$fid and $file are ok if my image is loaded but $file->setPermanent() seems not working, "status" information stay 0 in database -> file_managed table...
I am currently learning how to create custom entity types and then adding bundles to these, and got a bit stuck on something I'm sure is probably simple.
On the node content type I can change the title field when creating a bundle (Or sub type if you prefer).
I have created a custom entity type called groups (So another type same as Node) and within it I am creating bundles for each type of group.
I would like to change the label for the title (Created as part of the custom entity type), depending on which bundle I am viewing.
I'm using the Form API to allow authorized customers to upload a CSV file to create nodes. My buildForm() method uses managed_file field and the validateForm() does the bulk of the work where I can return feedback to the customer as I parse and process the file using $form_state->setErrorByName() method.