Module to create a menu entity

There is a module for Magento 1 that creates a menu Entity without creating elements for the frontend. A menu entity like that of Drupal, the possibility to create infinite menus and within each menu infinite items nested. Then the developer will programmatically print the menu where it is needed. Can you suggest me?

Drupal 8 Image moving to another location when entity update

I have an image field in my content type and when I upload image it will save to a location as expected. Now I want to move that saved image to another location when entity inserting or updating process. Can anyone help?

I tried using image->save($ newlocation) but when the entity loading it will give an error as can’t find source image.

What is the use of DTO instead of Entity?

I am working on RCP application, I’m new to this application.

Spring beans are used to write business logic to save/fetch entities.

But, instead of sending entities directly to client we are converting to DTOs and populating client. While saving, we again are converting DTO to entity and saving.

What’s the benefit of these conversions? Can someone explain?

How do I delete files attached with media entity in drupal 8.4.2?


drupal 8.4.2

custom media solution


I can not delete files permanently which created as media entity.


  1. Created an image media entity.
  2. /admin/content/files claims status permanent and used in 2 places.
  3. After deleting newly created media entity from UI /admin/content/media.
  4. /admin/content/files says status permanent and used in 1 places.

Even cron run after 6 hours (as described in file settings) file still exist on the server.

Is there any safest or best way to delete those unused file permanently?

Should I use entity framework for CRUD and let the database handle the complexity that comes with high end queries?

I am new to ef and liking it since it reduces the overhead of writing common queries by replacing it with simple add, remove functions. Agreed.

Today I got into the argument with my colleague who has been using it for a while and approached him for advice on when to use Stored Procedures and when to use EF and for what?

He replied;

Look, the simple thing is that you can use both but what’s the point of using an ORM if you are doing it all in database i.e. stored procedures. So, how would you figure out what to do where and why? A simple formula that I have learned that use ORM for all CRUD operation and queries that require 3-4 joins but anything beyond that you better use stored procedures.

I thought, analyzed and replied;

Well, this isn’t the case, I have seen blogs and examples where people are doing massive things with EF and didn’t need to write any procedure.

But he’s stubborn and calling it performance overhead which is yet beyond my understanding since I am relatively new as compared to him.

So, my question is that whether you only need to handle CRUD in ef or should do a lot more in EF as a replacement of stored procedures.

How to favor exact matches in entity reference autocomplete?

Right now if you use entity reference autocomplete for short titles of a node type or entity type, and you have many items, due to the fact that by default they are ordered by entity id (nid), less relevant entries show up before exact matches.

For example, if you create a content type for stock symbols, and you have tens of thousands of them, and you want to search for “EA” or “DIS”, longer strings that contain these substrings show up before exact matches.

How can you change the behavior so exact matches show up before other matches with lower entity ids?

How to add new field to Node entity bundles

I want to add a new (SVG) icon to the Node entity so that I can specify a user editable icon per content type (not per node instance). I could then display the icon in various node templates.

I haven’t found anything concrete on how to best handle this. Is there a hook/plugin I can create to add a new field to the configuration page? If I add a new field via a form alter, where should I save this extra information?

Use custom template for custom entity in D8

I have created a custom entity via drupal console, and it created template item_entity.html.twig in template folder, but the entity is being rendered in some other way because any changes in template not work. How to figure out how this process works and to make it rendered through a custom template?

Entity definition:

* @ContentEntityType(  *   id = "item_entity",  *   label = @Translation("Item entity"),  *   handlers = {  *     "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",  *     "list_builder" = "Drupal\item\Utils\Item\ItemEntityListBuilder",  *     "views_data" = "Drupal\item\Entity\ItemEntityViewsData",  *     "translation" = "Drupal\item\Utils\Item\ItemEntityTranslationHandler", 


entity.item_entity.canonical:   path: '/item/{item_entity}'   defaults:   # Calls the view controller, defined in the annotation of the item entity     _entity_view: 'item_entity'     _title: 'Item Content'   requirements:   # Calls the access controller of the entity, $  operation 'view'     _entity_access: 'item_entity.view' 

In twig file data is rendered from:

<!-- BEGIN OUTPUT from 'core/themes/stable/templates/layout/region.html.twig' --> 

Springboot плагин для Eclipse строящий UML базы на основании Entity

День добрый, Есть сервлет написанный с использованием springboot с большим количеством классов, который не работает, причина в структуре БД,которая должна создаваться посредством hibernate, с помощью какого плагина для Eclipse, я могу визуализировать все Entity в uml для отладки сервлета.