Categories
CMS Drupal Mastering Development

Limit permissions to user

User A can add a product one time; user B can add a product 10 times; user C can add a product unlimited times. Limit access by user permission on Drupal 8. How can I solve it?

Categories
CMS Drupal Mastering Development

How can I build a complex table?

Do you now how I can build complex table in Drupal? I want to get something like this (in upload picture). I have nodes with these fields: nid, code, name, date, and sum.

Categories
CMS Drupal Mastering Development

How can I build a complex table?

Do you now how I can build complex table in Drupal? I want to get something like this (in upload picture). I have nodes with these fields: nid, code, name, date, and sum.

Categories
CMS Drupal Mastering Development

How can I build a complex table?

Do you now how I can build complex table in Drupal? I want to get something like this (in upload picture). I have nodes with these fields: nid, code, name, date, and sum.

Categories
CMS Drupal Mastering Development

How to automatically flag entities once (without PHP error)?

I created a custom module to automatically flag new entities and update entities. It works 🙂 Here is the problem : If I update a neud it is flagged. Perfect that’s what I want to do, but if I update the node again, I get a PHP error. This is normal because the custom module […]

Categories
CMS Drupal Mastering Development

Drupal 8 custom Block buid function to set body text

I am learning to build custom blocks through a module. I am trying to get the build() function to work. I have the code and it works. However, if I edit the configuration of the block as a user it does not print the text in the text formatter. ‘#markup’ => ‘<div>’ . $this->t(‘Body: @body’, […]

Categories
CMS Drupal Mastering Development

How do I programatically change a field widget in a form display?

I have an entity reference field. I want that field to use the simple inline entity form widget in some cases, and entity select widget in another case. Could you please help on how to do that?

Categories
CMS Drupal Mastering Development

Why does composer remove a folder it doesn’t manage

I have the gesso theme installed in themes/contrib, and since I have not subthemed, all my components and templates live in within its folders. For that reason, I do not manage it with composer. I needed to install a contrib module, and when I ran composer require, the first thing it did was remove gesso. […]

Categories
CMS Drupal Mastering Development

Some pages hide content unless “Read more” is clicked

If I have multiple pages on Drupal, some show the full page, and others say "Read more" and will only show the whole page when it is clicked. It doesn’t seem to have anything to do with the size of the content of the page or how long it is. What’s up with that?

Categories
CMS Drupal Mastering Development

How do I flag new user accounts or updated accounts?

I created a custom module to automatically flag new user accounts and updated accounts. When I create a new user or update an existing account, it is not automatically flagged and there is no error message in the log. How do I flag new user accounts or updated accounts? This is the code I am […]