Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality for extending/overwriting non-cms components #19606

Open
timoblume opened this issue Nov 21, 2024 · 0 comments
Open

Add functionality for extending/overwriting non-cms components #19606

timoblume opened this issue Nov 21, 2024 · 0 comments

Comments

@timoblume
Copy link

The Problem
Whenever you want to overwrite a component that is static (not a cms component) you cannot do that easily. You need find the next cms component around the static component, so that you can overwrite that one, in order to make the change. This might add a lot of code for possibly a tiny change (e.g. a custom css class or label). The approach also only works in that one specific place (in the cms component) and not across the entire application.

Spartacus provides a couple of outlets but these do not seem to work reliably in most cases, so that our developers have stopped trying to use them. Sometimes outlets render content multiple times, or not at all (#17711). We know the developers have put thought into the outlet functionality and tried to find places in the application where they think customers might need customization. In the real world however these places are hardly ever sufficient.

Angular does not seem to provide an easy solution for this problem. Otherwise I think this would already have been solved.

What I would like to see
Possible solution:

  • A config based solution like the one we have for cms components to provide you own implementation for a given static component.

Alternatively:

  • A directive that can be added to your own component that the replaces the referenced cx component
  • make more use of content projection in spartacus components that can be addressed by ngProjectAs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant