This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

How do I make a twig per bundle in my module

Hi

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

my module.module

Image appearance settings -> setPermanent()

Hello

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...

Changing the title label in a custom entity type

HI Folks

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.

database table shows a node connect to a category which is not exist

Hi All,

I created a field for article content type named field_category, and connect this field to category term.

Today I found a strange problem, in my code can get the category term id of an article:

$termId = $node->get('field_category')->target_id;

The $termId is 2 , when I try to load this term object use below code:

Input Format Filter

I am working on custom filter by referring https://www.lullabot.com/articles/creating-a-custom-filter-in-drupal-8 article.

Here I am trying to get field name which is being processed in process method. Any help would be appreciated.

Thanks !

Using managed_file for CSV parsing (validation fails)

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.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions