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

Command icon 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

roderik created an issue. See original summary.

roderik’s picture

Issue summary: View changes
roderik’s picture

Issue summary: View changes
roderik’s picture

Issue summary: View changes
fago’s picture

Title: Ignore tag prefix for CE objects » drupal prefix is added to configured custom element names

as 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

fago’s picture

Priority: Normal » Major
roderik’s picture

fago’s picture

Title: drupal prefix is added to configured custom element names » Improve custom-element default names for entiteis
Category: Bug report » Task
Issue summary: View changes

re-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.

fago’s picture

Status: Active » Needs review

create 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.

  • roderik committed 80278bc3 on 3.x authored by fago
    Issue #3449151 by fago, roderik: Improve custom-element default names...
roderik’s picture

Status: Needs review » Fixed

Thanks! Merged, after fixing a failing test (I guess it was just a typo) - and created #3469196: Doublecheck CustomElementsRenderMarkupTest results for later.

fago’s picture

update: nevermind

Status: Fixed » Closed (fixed)

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