Right now each of our entity types uses "content" as the object name in Twig.
We end up with content.title for the product title for example.
Instead, let's use the Commerce entity type, without the "commerce_" prefix. For example, product, product_attribute, order.
Let's also modify the variation field injection prefix to be 'variation_' instead of 'product_variation'. That gives us product.variation_sku and product.variation_price.

CommentFileSizeAuthor
#3 rework_the_naming_of-2727831-3.patch11.88 KBmglaman

Comments

bojanz created an issue. See original summary.

bojanz’s picture

Note that the entities will need to get the '_entity' suffix, so 'product' becomes 'product_entity' (because 'content' became 'product').

mglaman’s picture

Status: Active » Needs review
StatusFileSize
new11.88 KB

Patch, PR inc.

mglaman’s picture

  • bojanz committed c087bf7 on 8.x-2.x
    Issue #2727831 by mglaman, bojanz: Rework the naming of template objects
    
bojanz’s picture

Status: Needs review » Fixed

Committed the final version.

Status: Fixed » Closed (fixed)

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