Creating Custom Fields

Brightspot renders the standard field types in the content edit form as described in Field Types. You can customize a field’s rendering using a servlet, and annotating the field with the path to the servlet.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
package content.video;

import com.psddev.cms.db.Content;
import com.psddev.cms.db.ToolUi;

 public class Video extends Content {

     @ToolUi.InputProcessorPath("/custom/videoPreview.jsp")
     private String videoPreview;

 }

In the previous snippet—

  • Line 9 is a String field.
  • Line 8 replaces Brightspot’s default rendering of String fields with the output from the servlet at /custom/videoPreview.jsp.

See also: