Customizing Content Type Fields in Oracle Content Management Cloud
How to Create Dynamic or Dependent Select List Fields for Content Contribution
By Courtney Dooley | Technical Architect
Oracle Content Management Cloud allows for text fields to be a select list of options but does not allow dynamic population from an external source without customization. Outlined below are two customization methods available, and the benefits and tips for using each when customizing content type fields.
Custom Field Editors
Within Content Management Component Development tools is an option to “Create Content Field Editor”. When creating the component, the data type and handle multiple values fields are required, however the resulting component is not altered by those selections. Those selections drive where this component will be available. Without any customization, is not ready for use.
The component is created with an “assets” folder containing two files; view.html and edit.html. Modifications are needed for edit.html, typically view.html can stay as the default. Without modifications to edit.html the text field is replaced with a simple input field and JavaScript functions save the data to and recall data from the asset as the field is changed.
To create the select list with options supplied from an external source, we need to update the html and associated CSS to match the system fields, then add a JavaScript function to call and create the options for that select list.
Onload the getCountries function will be called, and the drop down will populate from the results. Additional html tags and functions can be configured for validation prior to saving the selected value to the asset.
Benefits of using Form Editors:
Multiple fields can be created within a single editor. System or other custom fields can be accessed, and their values used within JavaScript functions. When modifications are made to the content type definition, the custom editor does not require changes unless the field, or its custom functionality is impacted directly by the change.
Tips when using Form Editors:
Any custom development in a cloud environment needs to be validated after upgrades and patches to make sure recent changes to the environment do not negatively impact the custom developed field editors. It’s also important to validate the field values properly to avoid frustrating errors that only display after save has been requested causing lost work.
Custom Form Editors
Unlike the custom field editors, Custom Form Editors replace the system form entirely. This allows the content saved to the asset to be structured entirely differently than how the entry form collects it. For example, the screenshots below show a “Product” content type with multiple fields describing the product, but a single search and drop-down selection field is presented on the creation page.
On change that selection provides values for all the asset fields, including Name, Description, and properties such as language and slug. Those values would never have to be displayed but could be populated and displayed upon creation.
Benefits of using Content Form Editors:
The form fields, functionality, layout, even styles are all editable using this component type. Libraries can be referenced to include 3rd party functions. Multiple system functions allow for use of Content Pickers, and Media Pickers.
Tips for using Content Form Editors:
At the time this is being written, system supported calendar functionality for date fields is not available, so additional date picker functionality will need to be implemented. This custom form editor should be developed with a function that creates the default type fields dynamically from the content type definition; otherwise, any change to the content type fields will require modifications to the custom form. A custom form can easily become a bottle neck for content type changes if not designed with this in mind.
As you can see, Oracle Content Management Cloud has flexible robust standard forms that allow for a range of options to expand the tools capabilities by customizing content type fields.
Contact Us for more tips and tricks for developing custom Content Contribution Forms!