Information for: DEVELOPERS   PARTNERS   SUPPORT

Making changes to the content model

The Acquia CMS content model is intended to be used as provided or as a starting point. You can update the content model to meet the requirements of your information architecture. This page provides information on what happens if you add, update, or remove fields from the content model.

Note

This page uses content types as an example, but the same applies for media types and taxonomy vocabularies.

Adding a new field

Best Practices

Follow Drupal best practices to add new fields to content types:

  1. Sign in to Acquia CMS.

  2. In the Acquia CMS administrative interface, click Manage > Structure > Content Types > Select Content Type > Manage Fields.

  3. Click Add field.

  4. In Add a new field, select field type from the dropdown menu.

  5. In Label, enter a name.

  6. Click Save and continue.

  7. Select the number of items you want to allow. You can select Limited or Unlimited based on your requirements.

  8. Add help text

    Based on your requirements, confirm whether the default value is required.

  9. Click on Save settings.

  10. Verify the changes on your site.

Capturing configuration

You can capture configurations from the applications administrative user interface.

  1. Sign in to Acquia CMS.
  2. Enable the Configuration Manager module.
  3. In the Acquia CMS administrative interface, click Manage > Configuration > Development > Configuration Synchronization > Export.
  4. Click Single item.
  5. In Configuration Type, select Field from the dropdown menu.
  6. In the Configuration name dropdown menu, select the field you added to the content type.
  7. In your config/sync directory, create a new file with the suggested filename on the Config export page.
  8. Copy and paste the text from Here is your configuration.
  9. In Configuration Type, select Field storage from the dropdown menu.
  10. In your config/sync directory, create a new file with the suggested filename on the config export page, and copy-paste the text from Here is your configuration textarea.

Subsequent updates

Your configurations are kept when a new update is released to the Acquia CMS module. Drupal only reads and updates configuration once when the module is first installed.

Updating an existing field

Acquia does not recommend making changes to the fields that are included with Acquia CMS. Instead, Acquia recommends creating new fields as per your requirement. For information about adding new fields, see Adding a new field.

Removing an existing field

Best Practices

Follow Drupal best practices for adding new fields to content types:

  1. Sign in to Acquia CMS.

  2. In the Acquia CMS administrative interface, click Manage > Structure > Content Types > Select Content Type > Manage Fields.

  3. In the Operation of the field you wish to remove, click on the dropdown arrow.

  4. Click Delete.

    The system redirects you to the confirmation page.

  5. Click Delete.

  6. Verify the changes on your site.

Capturing configuration

You must capture the configuration once you make changes for future reference. You can use drush to export configurations such as drush cex. If it exists, delete the configuration file of the deleted field from the config/sync directory.

Subsequent updates

Your configurations are kept when a new update is released to the Acquia CMS module. Drupal only reads and updates configuration once when the module is first installed.

Note

If there are updates to the deleted field in subsequent module updates, hook_update_N() throws an error that the configuration does not exist.

Updates to unmodified fields

If Acquia CMS makes an update to a field type on a content type, and you have not made any changes to that field, the Acquia CMS update is applied when you update Acquia CMS.

For example, there is a provided content type and it has an autocomplete text box field. A future update changes that field to a checkbox. The following are applied:

  • If you have not changed the field, the update changes the field from an autocomplete text box field to a checkbox when you update Acquia CMS.
  • If you removed the field, the update changes do not recreate that field again. The Acquia CMS update does not impact you.
  • If you changed the field, the update changes do not apply to the field because you changed the original field.

The Acquia CMS update only applies if the original field exists with no modifications.