Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
contentful-ui-extensions-sdk
Advanced tools
The UI Extensions SDK allows you to customize and extend the functionality of Contentful Web Application's entry editor. The editor itself is a container for many components that enable editors to manipulate the content stored in content fields. Extensions can be simple user interface controls, such as a dropdown, or more complex micro web applications such as our Markdown editor. They are decoupled entities from field types, and can be reused (for example using a dropdown to edit number or text fields).
Previously, the Contentful Web Application only offered our core platform components to manipulate fields' content. Now, with the UI Extensions SDK it is possible to personalize this Web App based on your needs. Core components and custom extensions are both built on top of the same API, leading them to follow the same approach. The main difference resides in the fact that custom extensions are rendered inside a secure iframe. The next step in our roadmap is to open source our core components to extend them or give more insights on how to build custom extensions.
Every Contentful user has access to this feature, it is enabled by default, and all requirements to start using it are simply to follow the instructions contained here.
This SDK overview introduces you to the concept of custom extensions and lists concrete usage examples. The extension API documentation, on the other hand, provides in-depth information on what the API exposes to the consumer.
You can also refer to the [following FAQ][FAQ.md] for questions related to hosting, or limitations.
Conceptually, there are two main categories of custom extensions, for content editing and content management.
Content editing extensions can operate on either single fields, or multiple fields.
Content editing extensions applied to single fields are great for circumstances where you just want to customize how you edit a particular field type. Examples of single field extensions are:
If you need more than a single field, you can try multi-field level extensions. Currently we have two approaches for this:
The first is a simple approach is to use a JSON object field type and construct any complex field type that is not provided out of the box by Contentful, along with its UI and logic. However, there is a tradeoff when using this approach. Data inside of a JSON field cannot be used to query or filter entries in our APIs.
This approach involves creating a single field custom extension that can use our CMA to perform operations on other fields within the entry. Examples of multi-field-level extensions are:
Content management extensions reside on the sidebar and allow for actions that include every element in the entry. These are better suited for tasks related to workflows, data-management, integrations, etc. Examples of entry-level extensions are:
The most convenient way to upload and manage extensions through our API is via the
contentful-extension
command line tool. You can install it with
npm install -g contentful-extension-cli
Including the compiled version of the extension client library is as simple as adding the following line to your application.
<script src="https://contentful.github.io/ui-extensions-sdk/cf-extension-api.js"></script>
It also provide a set of examples you can check out to get a deeper understanding of the SDK capabilities.
To get an overview over the API, have a look at the reference documentation
As extensions are rendered inside an iframe, you will need to include the
cf-extension.css
library within your custom extension in order to use any of
Contentful's styles.
You can include this CSS in your extension code as follows:
<link rel="stylesheet" type="text/css" href="https://contentful.github.io/ui-extensions-sdk/cf-extension.css">
Futher information about styling your extension can be found in the styleguide.
Our extensions repository includes the following example extension implementations. Before you can
use them, you need to run npm install
in the repository root.
This example is a basic extension meant to help you get started with custom extensions development. Uses a dropdown to change the value of a number field and makes some CMA requests.
This example integrates the Alloy rich-text/HTML editor to edit “Text” fields. Great to personalize the entry editor and enable HTML editing as an alternative to Markdown.
This example will automatically generate its value from an entry's title field. For example typing “Hello World” into the title field will set the extensions input field to “hello-world”. It will also check the uniquness of the slug across a customizable list of content types. It highlights how the extensions SDK can be used to inspect any value of an entry and react to changes.
This example provides a JSON formatter and validator based on the Codemirror library. It should be used with fields with the type “Object”.
This example integrates the JSON Editor library to display an edit form based on a predefined JSON Schema. Form input gets stored as a JSON object.
This example translates text from the default locale to other locales in a space using the Yandex translation API.
This example loads videos from a project on wistia into the Contentful Web Application. A video can be easily previewed, selected and then stored as part of your content. In this example extension we store the video embed URL in Contentful so the video can be embedded easily.
This example extracts the video id from a valid YouTube URI. Useful as a simple way to integrate with 3rd party media services.
The diff editor extension shows the diff between the draft value and the published value of a short text field.
This example displays a chessboard and stores the board position as a JSON object. You can drag pieces on the chessboard and the position data will be updated automatically. The extension also supports collaborative editing. If two editors open the same entry moves will be synced between them. It highlights the flexibility and potential of solutions that can be built using the UI Extensions SDK.
Technical feedback can be provided directly through the Github repo. However, if at any point some confidential or business sensitive information needs to be discussed, then the conversation should be handled via our formal support channels.
FAQs
A JavaScript library to develop custom apps for Contentful
The npm package contentful-ui-extensions-sdk receives a total of 1,177 weekly downloads. As such, contentful-ui-extensions-sdk popularity was classified as popular.
We found that contentful-ui-extensions-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.