- Issue created by @DamienMcKenna
- 🇮🇱Israel jsacksick
Hm... I don't really think it makes sense for variations to have their own url...
Let's take t-shirts for example, I've never browsed a single site that offers a dedicated page for the RED small variation of a particular t shirt.If you take books, you often have the ability to get the digital version, or the hard copy, having a dedicated page for the digital version or the hard copy wouldn't really make sense either to me?
So could you elaborate on:
There are many scenarios when the product variant wants to be displayed on its own
?
- 🇺🇸United States DamienMcKenna NH, USA
a) Product = a course at a college, Product Variant = a specific instance of that course.
b) Whatever scenario this person is using it for: 💬 Product Variation meta tags not working ActiveI'm not saying every scenario needs it, but it should be possible.
Is there a hook or event that allows the entity's definition to be modified? I wonder if this could be done as a separate contrib module?
- 🇮🇱Israel jsacksick
@DamienMcKenna: yes, this can be done via a hook_entity_type_build(), see the following code from the core action module:
/** * Implements hook_entity_type_build(). */ function action_entity_type_build(array &$entity_types) { /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */ $entity_types['action'] ->setFormClass('add', ActionAddForm::class) ->setFormClass('edit', ActionEditForm::class) ->setFormClass('delete', 'Drupal\action\Form\ActionDeleteForm') ->setListBuilderClass('Drupal\action\ActionListBuilder') ->setLinkTemplate('delete-form', '/admin/config/system/actions/configure/{action}/delete') ->setLinkTemplate('edit-form', '/admin/config/system/actions/configure/{action}') ->setLinkTemplate('collection', '/admin/config/system/actions'); }
- Status changed to Closed: won't fix
5 months ago 6:45am 2 July 2024