Is there is way to remove or rename a field in Sitecore JSS via template definitions?

Even with an ID on the field, it won't rename. Deleting the field object will not delete the field in Sitecore.

We want to use code-first templates, but this could give some problems.

up vote 3 down vote accepted

Import very specifically does not rename or delete items. Per the docs:

Import does not purge unknown items

If a template or route is removed from the manifest, it is not deleted from Sitecore on the next import.

If you want to follow default conventions and have Sitecore look entirely like your manifest and nothing else, consider using wipe import (-w on the CLI) which will purge imported items before recreating them all. Wipe will prompt by default; --unattendedWipe will disable the prompt for CI scenarios.

If you're going to get advanced with your items though, use an item serialization tool to maintain the app's state from the Sitecore side.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.