Problem/Motivation
Steps to reproduce
Have CE display for user, with customElementName "user" (e.g. loaded from config)
Render a user with it
Get <drupal-user .....>
Proposed resolution
customElementNames should be usable as configured. Apply new naming pattern:
* For rendering content entities, we do not add a drupal- prefix. We apply the following pattern: `{ENTITY_TYPE}-{BUNDLE}-{VIEW_MODE}` or when the entity does not use bundles `{ENTITY_TYPE}-{VIEW_MODE}`. The view-mode suffix should be optional.
* Also, for the default view-mode we do not append the "-default" suffix, since e.g. "node-article[...].vue" clearly is already default, there is no "node-article-default" element needed.
Remaining tasks
Ignore the tag-prefix which is added by the 'settings defaults', somehow.
Maybe (or maybe not) not for new ce_display objects -- certainly for existing/loaded ones.
User interface changes
API changes
Data model changes
Issue fork custom_elements-3449151
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
roderikComment #3
roderikComment #4
roderikComment #5
fagoas I understand the problem is the configuration is not applied 1:1 as expected. yeah, we should allow setting some explicit '' prefix and simply do so when generating the element from config
Comment #6
fagoComment #7
roderikSee spec in #3351239: Define and establish best-practice CE naming pattern
Comment #8
fagore-titling to implement the spec mentioned by roderik - this includes removing the drupal prefix for entities.
Here the relevant spec
* For rendering content entities, we do not add a drupal- prefix. We apply the following pattern: `{ENTITY_TYPE}-{BUNDLE}-{VIEW_MODE}` or when the entity does not use bundles `{ENTITY_TYPE}-{VIEW_MODE}`. The view-mode suffix should be optional.
* Also, for the default view-mode we do not append the "-default" suffix, since e.g. "node-article[...].vue" clearly is already default, there is no "node-article-default" element needed.
Comment #10
fagocreate the MR with the necessary changes. Short summary:
* The default names are updated according the described pattern
* Thunder module default config has been updated to follow it. Strictly speaking some BC-break, but well we do general new CE-UI names in 3.x so this just part of it. We should not be afraid to change it. When necessary it can be re-configured to old values anyway. (any drunomics-internal necessary changes due to can be done later)
* I ran into some fatal error due to hidden being ended up "null" in some config when editing displays due to some parent code in the parent class. We should keep it an empty array instead of making it null to avoid troubles there.
* Tests have been updated to follow the changes and use the new names. There is one change in the functional test markup though. will comment there.
Comment #12
roderikThanks! Merged, after fixing a failing test (I guess it was just a typo) - and created #3469196: Doublecheck CustomElementsRenderMarkupTest results for later.
Comment #13
fagoupdate: nevermind