Short text custom field

To add a custom field to a content item, perform the following:

  1. Open the module where you want to add a custom field.
    If you want to add a custom field for pages, in the main menu, click Pages.
    For example, open the Images page or the Events page, or click Pages.
  2. In the right side of the screen, click Custom Fields link.
    The <Content type> data fields page appears. The system displays a list of all custom and default fields for that content type or page.

    For example, on News page, click Custom fields for news link and the News data fields page appears. On Pages page, click Custom fields.

    NOTE: You can add and delete custom fields, but you cannot add or delete default fields.

  3. To add a custom field, in Custom fields section, click Add a field… button.
    A window opens.
  4. In Type dropdown box, select Short text.
  5. Enter a name for the field.
    The name of the field is different from its label. The name of the field serves as reference for that field in the backend.
  6. If you select This is a hidden field checkbox, the custom field is not visible on the website or in the backend, you can only use it in the code.
    You can later unhide the field, by clicking it in section Custom fields and changing the selection on Appearance tab.
  7. In Interface widget for entering data dropdown box, you select the widget which the creator or editor of the content item or page will use to complete the field. 
    The default widget is Textbox. It displays an input field with labels and instructions.
  8. Expand the Advanced section, if you want to change the database and the SQL database type of the custom field, if you want to specify the name of the column of the database table where the custom field is added, and if you want to make additional advanced settings.

    If the Allow empty values checkbox is selected, it means that the field is not required and can be left empty. If you deselect it, the field becomes mandatory.

  9. Click Continue.
    A window appears where you must configure the appearance of the custom field, such as labels and instructions.

Label and texts

On this tab, perform the following:

  1. In Label input field enter the label of the textbox.
    For example, enter Home address or E-mail.
  2. If needed, in Instructional text, enter instructions or explanatory text for the textbox.
    The text is displayed bellow the textbox.
  3. If required, in Predefined value, enter a predefined value for the textbox that is displayed in the box by default and the user can change it.
  4. If you want to make the textbox mandatory, select the Make required checkbox, .
    A textbox appears, where you enter the error message that is displayed, if the user does not fill out the textbox.
  5. If you have a multilingual site, you can select or deselect Make localizable checkbox.
    This allows you to translate the field in the different language versions.
    By default, the checkbox is selected.

Limitations

On this tab, perform the following:

  1. In Number of characters allowed, enter the minimum and maximum number of characters that a user can enter in the textbox.
    If you do not want to impose limits to the textbox, leave the Max input field empty and the Min input field 0.
  2. Enter an error message that is displayed, if the user enters less than or more than the defined limits.

Appearance

On this tab, perform the following:

  • If you do not want to display the custom field on all screens where you work with the content item, you can select the checkboxes of only those screens where you want the field to be displayed. To do this, select Some screens where you work with <content type> in the Backend… and select the screens where you want the custom field to appear.

    NOTE: When you are adding a custom field to Images, Videos, or Document, this field is displayed on the upload screen, when you upload items via the Image widget, Video widget, or Document link widget widgets. If you do not want to display the custom fields, deselect the upload screens.

  • If you have made the field a hidden field, radio button Nowhere. This is a hidden field is selected on Appearance tab when you open the field for editing. If you change the selection, the field is no longer hidden.
    If the field is not hidden, you can hide it by selecting Nowhere. This is a hidden field radio button.
  • On Appearance tab, in CSS class input field, you can choose a class name for the custom field if later you want to set a CSS style for this particular field.

When finished, click Done.
The new field appears in the list of custom fields for the respective module.
If you want to delete a custom field, click .

Save your changes.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?