Making content from a REST endpoint available to Uniform
This recipe covers how to use Uniform to connect to an external system with content you want to use in Uniform, without having to write any code. In this example, reading content from the external system is accomplished using a REST endpoint.
The external content source in this example is a WordPress blog. You will make posts from the blog available in Uniform.
Interested in WordPress?
This recipe uses WordPress as an example, but it is not about WordPress specifically. For more details on how to use WordPress with Uniform, we have a lesson on our Connect portal.
Video walk-through#
This video walks you through the process of incorporating content from a WordPress site into a page built in Uniform.
Step-by-step#
This section provides instructions to build the data resource demonstrated in the video above.
Create the Data Source#
- In Uniform, navigate to Data Types.
- Click the button Add data type.
- For Data Source, select HTTP Request > Create new....
- Enter the following values:
Parameter Value Base URL https://public-api.wordpress.com/rest/v1.1/sites/227813160
Name WordPress Site
Public ID wordpressSite
- Click Save.
Create the Data Type#
- Under the section Request settings, next to the dropdown with GET selected, enter the following value:/posts/
- Enter the following values:
Parameter Value Name WordPress Posts
Public ID wordpressPosts
- Click Save.
Use the Data Type#
In order to use the data type, you must create a Data Resource. These can be created in a number of places, depending on what you are trying to accomplish:
Location | Use cases |
---|---|
Component Patterns | A business user can use content from the external system in the specific component type. |
Compositions | A business user can use content from the external system on parameters on the composition, or any of the components in the composition. |
Content Entry Patterns | A business user can use content from the external system on fields on a specific content type. |