You can add an Ooyala custom field extension to your stack that allows you to fetch Ooyala videos and display them into a field in your Content Type. Subsequently, while creating entries, you can select one or more videos as input value for the field.
This step-by-step guide explains how to create an Ooyala custom field extension for your content types in Contentstack. The steps performed are as follows:
- Add the ‘Ooyala’ custom field extension to your stack
- Use your custom field
Step 1 - Add the ‘Ooyala’ custom field extension to your stack
- Go to Settings > Extensions. Click on the ‘+ Add Extension’ button on the top-right corner and select ‘Create new.
- Select Custom Field.
- On the configuration page, enter details in the fields as given below:
- Title: Provide a suitable title. For example, ‘Ooyala’.
- Field Data Type: Select the data type in which the input data of the field should be saved in Contentstack. Select Text in this case.
- Multiple: Leave this checkbox unchecked.
- Hosting method: Select ‘Hosted By Contentstack’. As soon as you do this, you will see the ‘Extension Source Code’ field below.
- Extension Source Code: Enter the source code for the extension. You can find the source code for the Ooyala extension here.
- Config Parameter: To configure your Ooyala custom field, you need to provide your Ooyala API credentials which include your API key and secret. These will be used to sign all HTTP requests. You also need to make use of proxy servers. Refer the Authenticating your requests section to know more about them.
Alternatively, you can make use of the Ooyala npm package provided here.
Enter the configuration details in your custom field's settings as follows:
For more details, you can refer to Ooyala docs.
- Click on ‘Save’. This creates your custom field.
Now, let’s understand how you can start using this custom field in your content type.
Step 2 - Use your custom field
To use your custom field, you need to follow the steps given below:
- Create a content type by clicking on the ‘+ New Content Type’. Enter the relevant details for the content type and click on ‘Create and Add fields’.
This leads you to the ‘Content Type Builder’ page where you can add the relevant fields.
- Add the ‘Custom’ field in your content type.
- Select Ooyala from the dropdown and set the other properties of your custom field.
Note: You can provide specific instance-level configuration settings for your Custom Field extension. Learn more.
- After adding other relevant fields in your Content Type, click on Save and Close.
This will create your Content Type. Now you can use the custom field while creating an entry for this Content Type as shown below: