Hybris
Hybris

Reputation: 97

Spartacus: Override cx-update-profile to add/modify input fields in PersonalDetails

Am trying to modify Personal details page in myaccount, i want to add new input fields, remove some existing input fields, how to achieve this, appreciate your help. Thanks.

Upvotes: 0

Views: 509

Answers (1)

Erik Slagter
Erik Slagter

Reputation: 239

General way of replacing a CMS component

  • find the flexType of the component, or the component typecode from the /pages request in your browser tools - network tab.
  • generate a module and a component with the ng-cli (ng g m your-profile-details followed by ng g c your-profile-details
  • configure your component to be used https://sap.github.io/spartacus-docs/customizing-cms-components/#page-title
  • copy the entire HTML from the OOTB source code
  • in the *component.ts file, you extend the OOTB component extends XXComponent
  • sometimes you have to copy the implementation as well, depending on the visibility of the attributes / functions in the OOTB component.

Run yarn run start and verify if your component is now in use!

Modify your component HTML to your liking.

Upvotes: 3

Related Questions