- Issue created by @mglaman
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I proposed this in chat with @mglaman, so I obviously +1 it π
This can then become one of the requirements for a content entity type to be XB-eligible: π Allow XB to be used on all node types Active . π€
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Per #3498525-36: [later phase] [META] Allow XB to be used on any content entity type (bundle), as long as it has certain entity type characteristics β , this would ideally become another entity type characteristic in Drupal core.
That means it should get something like
EntityPublished(Interface|Trait)
, so something like:/** * Provides an interface for access to an entity's path alias. * * @ingroup entity_type_characteristics */ interface EntityPathInterface extends EntityInterface { /** * @return ?string * Path alias, if it has one. */ public function getPath(): ?string; /** * Sets the entity's path alias. * * @return $this */ public function setPath(string $alias); }
+
/** * Provides a trait for path alias. * * @todo Port many (all?) of the generic hook stuff from \Drupal\path\Hook\PathHooks into this trait. */ trait EntityPathTrait { public static function pathBaseFieldDefinitions(EntityTypeInterface $entity_type) { if (!is_subclass_of($entity_type->getClass(), EntityPublishedInterface::class)) { throw new UnsupportedEntityTypeDefinitionException('The entity type ' . $entity_type->id() . ' does not implement \Drupal\Core\Entity\EntityPublishedInterface.'); } if (!$entity_type->hasKey('path')) { throw new UnsupportedEntityTypeDefinitionException('The entity type ' . $entity_type->id() . ' does not have a "published" entity key.'); } return [ $entity_type->getKey('path') => BaseFieldDefinition::create('path') ->setLabel(new TranslatableMarkup('URL alias')) ->setRevisionable(TRUE) ->setTranslatable(TRUE), ]; } /** * {@inheritdoc} */ public function getPath(): ?string { return $this->getEntityKey('path')->alias; } /** * {@inheritdoc} */ public function setPath(string $path): self { $key = $this->getEntityType()->getKey('path'); $this->set($key, $path); return $this; } }
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
First step before implementing anything here: check if there's an existing core issue that proposes the same β chances are pretty high that's the case.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
β¨ Updating page title does not get reflected inside the navigator Active is having to introduce work-arounds because this hasn't been fixed yet.
- πΊπΈUnited States tedbow Ithaca, NY, USA
It is also unclear why we are doing this issue . AFIACT from the discussion in #3500052-27: Provide HTTP API for listing Page content entities that can be updated by the current user β it is so in the navigation and the site is sub-directory we should
/page/1
or/page-1-alias
and not/subdir/page/1
or/subdir/page-1-alias
. But it wasn't actually stated directlyIf that is case we should put that in "User interface changes"
- Status changed to Needs work
11 days ago 2:44pm 1 April 2025 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
wim leers β credited larowlan β .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
@tedbow in #8: Because https://git.drupalcode.org/project/experience_builder/-/merge_requests/7....
β¦ which will grow into a larger, more abstract problem once XB supports more content entity types in π Allow XB to be used on all node types Active .