It's not possible to theme a entity type. Drupal gives no theme suggestions. You can however theme a entity bundle. Please add template overrides for the entity types itself.

Comments

norman_pixelkings created an issue. See original summary.

legolasbo’s picture

Status: Active » Needs work
StatusFileSize
new2.94 KB

Attached patch adds a eck-entity.html.twig template to the project which can be overridden in your theme. I am aware of an issue with the template suggestions not getting picked up. That's still being worked on.

legolasbo’s picture

Status: Needs work » Needs review
StatusFileSize
new1.44 KB
new4.55 KB

You should now be able to override the template using the template suggestions.

legolasbo’s picture

StatusFileSize
new4.59 KB
new318 bytes

Now without whitespace problems.

legolasbo’s picture

StatusFileSize
new2.97 KB

Now also removed interdiff which got committed into my local repo by accident. So ignore previous patches.

joelpittet’s picture

Great idea!

+++ b/eck.module
@@ -161,22 +163,57 @@ function eck_menu_local_actions_alter(&$local_actions) {
+  $templates['eck_entity'] = [
...
+    'template' => 'eck-entity',

Don't need the explicit template. This will happen by default.

legolasbo’s picture

Status: Needs review » Fixed

  • legolasbo committed 124a883 on 8.x-1.x
    Issue #2622206 by legolasbo, joelpittet: Entity themable
    
legolasbo’s picture

Removed the explicit template as suggested by joelpittet and committed.

  • legolasbo committed 55c8781 on 8.x-1.x
    Fix notice generated by bug introduced by #2622206
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.