How to change the label for a field name

How to change the label for a field name

Task Description

This document describes how you can change the text label for a field: the name that appears next to a field on one of CollectionSpace's pages.

This is a display-only change. Changing the text label that appears next to a field on CollectionSpace's web pages doesn't actually rename the field. Stated another way: it does not change the underlying name of the field that appears in configuration files, in reporting, in data import and export, etc.

Prerequisites

This work requires knowledge of how to:

  • Make new directories, copy files, and perform similar tasks in your operating system.
  • Run commands at your operating system's command prompt.
  • Edit text files.

Also helpful is:

  • Familiarity with reading HTML markup.

In addition, if you have not already done so:

Layers involved

To carry out this task, you will need to make changes in the following CollectionSpace layer(s):

  • User Interface (UI)

Procedure

Find your tenant folder

 Click here to read these instructions (included in many documents on this site) ...
Unknown macro: {multi-excerpt-include}

(Or instead see Finding your tenant folder.)

Find the message bundle file for your tenant

  • Within your tenant folder, find the bundle/core-messages.properties-overlay file.
    • If this file and/or folder doesn't exist:
      • If needed, create a new folder within your tenant folder, named bundle
      • Create a new text file within the bundle folder, named core-messages.properties-overlay

After following these steps, you will then have this folder/file structure within the UI layer source code folder, inside the src/main/webapp/tenants folder:

 

Edit the message bundle file for your tenant

  • Edit the core-messages.properties-overlay file in a text editor.
  • Create or edit the text labels for the relevant field(s).
Unknown macro: {multi-excerpt-include}

See The message bundle file in the UI layer for detailed instructions on how to find and edit the relevant labels.

Example

Unknown macro: {multi-excerpt-include}

Copy your changes to the CollectionSpace server

 Click here to read these instructions (included in many documents on this site) ...
Unknown macro: {multi-excerpt-include}

(Or instead see Configuring CollectionSpace's User Interface (UI) Layer - An Overview.)

Test

After following the procedure above, use a web browser for the following steps:

  • First, clear your Web browser's caches.
  • If you are not already logged into your museum (tenant) on your CollectionSpace system:
  • Navigate to the page containing your change.
  • Inspect the text label next to the relevant field.

If it doesn't work

Expand as needed on the following bullet points, which are currently just telegraphic reminders:

If you don't find your label in the message bundle file:

  • Open the HTML template file for the relevant page, and find the class="" selector for the relevant field in that template.
  • Add a new line to the message bundle file, where the property value (to the left of the ":") will be ...

If the label change doesn't appear, make sure that:

  • You've reloaded the relevant page in your web browser to see your changes.
  • You've edited the correct file.
  • In that file, you've changed the label associated with the correct field. In addition to double-checking your editing, you can also open the HTML template file for the relevant page, and verify that the property value of the label you've changed closely matches the class="" selector for that field in that template.
  • You've copied (deployed) the changes in your tenant folder to your CollectionSpace server.
  • You've either restarted the cspace server or set up your server to automatically

See Also

These links may require updating.