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

Best way to alter Drupal entity?

One of the Drupal entities is Aggregator which comes with a defined set of how to save these entities using Drupal\Core\Entity\Sql\SqlContentEntityStorage

Would you agree with me that while I can alter the MySQL table that it would be ultimately self-defeating since it would be overwritten in the next Drupal core update? And better to alter it in a custom module?

With the new paradigm in Drupal 8, I don't know enough to say this is the best path? thx, sam

Add Operations to Exposed Filter Views list of entities

My view lists entities of a certain type and I need to let authorized users be able to run CRUD operations on them. Searching I find a suggestion that in D7 see how Drupal uses the Views API to do this. Makes sense, I would use that API for my custom module in D7. Now for D8, I suspect that the views would be a PlugIn.

Looking at /admin/content I understand that is a View of nodes with the operations I need. Looking at Webprofiler I see that the controller is not within Node, but within the Views module itself. So already my understanding is broken in D8.

How to set a custom class to submenus in Drupal 8?

I am working on sidebar menu in a Custom Drupal 8 Theme. I am trying to set a class of sidebar__menu--submenu-1,sidebar__menu--submenu-2, sidebar__menu--submenu-3 and so on depending on the level of the submenus.

So far, I was able to add the class sidebar__menu to the first level & sidebar__menu--submenu to all the submenus. However, I want to add the class sidebar__menu--submenu-(number of the level) so I can style & control the sidebar better on css.

Any help will be really appreciate it!

Here it is my code menu.html.twig:

Create multipages with the same custom module

Hello. First of all, sorry for my english, i am not really pro with languages. 

I am building a custom module. At this point i did a page, a form and can send it to database. Now i need build another page for update the data inserted in last form. I dont want to build another module, and i suposse there are other ways to do it on same module. 

Some help/guide would be great. Thank you.

I have this code on routing.yml:
 

integration of Dojo JS Framework with Drupal 8

Hi All,

I was trying to integrate Dojo JS library with Drupal 8.
I added the library in themes/custom folder and gave its reference in the libraries.yml file.
But this doesnt work. In console i get error as :

Uncaught ReferenceError: Backbone is not defined
Uncaught TypeError: Cannot read property 'util' of undefined
Uncaught ReferenceError: domready is not defined
Uncaught TypeError: Cannot read property 'toLowerCase' of null

Drupal::messenger()->addMessage() to selected $uid for server-server requests

What is the most elegant way to send a notification to a specified UID from an anonymous session? I have a webhook (function triggered by server-server request) that need to notify the relevant users about incoming payments from the bank.

What exactly do I need?

Drupal::messenger()->addMessage(t('Send message to selected UID=10.'), 'error', TRUE, $uid=10);

What I tried to achieve it?

Pages

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