View and Section Injection for the Custom EntityType's Default Entity Page

UPDATED 03/04/2025

I had to have everything customized for the section injection to work for the custom EntityType. Please see part 3 below.


Hello,

The customization issue I’m facing contains 3 cascading parts

  1. Firstly I wish to have a page section injected into the default Entity Page for the custom EntityType. However, this is only achievable in local development because the distribution build of Angular doesn’t provide enough identifiers for me to inject page sections via metadata.
  2. My workaround is to inject a custom Details view component to the default Entity Page, this way I can have enough identifiers (by using the component’s selector) to set in the context to inject the section.
  3. The last resort is to have everything customized, implementing a Page and a DetailsView for my custom EntityType.

Pt. 1 Page Section Injection for Custom EntityType’s Default Entity Page

I’m trying to inject a page section into the default Entity Page for custom EntityType but found out there is no sufficient identifier in the distribution-build DOM.

In the local development build, I can use the attributes generated by Angular to identify the element I wish to inject:

The attribute is not present in the distribution build:

Whilst there is **entitytype **and **entitytypename **attribute available for the system type Entity Page (even in the distribution build).

Pt. 2 Entity Page View Injection

I’m not able to inject views into the Entity Page by following the CMF Guide.

Component:

Template:

Route module:

And lastly the metadata (overriding the default Details View)

I can see the view’s name is taking effect, but not the view content:

I’ve also tried the EntityPages-specific instruction but with no luck.

I’m fairly new to Angular and would appreciate your help in reviewing my work to see if I’m missing anything. Thank you!

Pt.3 Custom Page and View

Entity Page

Details View

Metadata

Overriding the default entity page

Overriding the default details View.

Since the default details view displays too many properties and is causing errors,

I prefer not to spend more time on it as I have already worked on this topic for a few days.

Lastly the section

Working Result:

Regards,

Timmy.

















Hi,

I would be interested in the same questions Timmy posted.

I made the experience that replacing existing views does sometimes work and sometimes doesn’t.
For example, for resources, it works as described, for steps and flows for example it doesn’t. For custom entity types it doesn’t work either

If I remove the entity name and replace it with a * however, it works for custom entity type and some system ones, but not for all.
Feels really inconsistent here.

Have not tested it, but I assume we could add the new view, remove the default details one and then set the default view to the new one.
Don’t think that should be the way to handle this though

Best regards,
Maximilian

Hello Maximilian, your assumption is correct. My resolution is indeed to have both the Entity Page and Details View overridden with the custom components. Please see the updated content above. I have the same thought that the default page should have supported this kind of dynamic injection since this is part of the framework, but seems the default component has its limitations.