Coder Social home page Coder Social logo

robinandeer / contentful-suggest-category-ui-extension Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 0.0 11.35 MB

Contentful UI Extension for automatically suggesting category based on text input.

License: MIT License

CSS 5.81% HTML 5.63% JavaScript 88.55%

contentful-suggest-category-ui-extension's Introduction

Suggest Category Contentful UI Extension

Sponsored

Example UI extension for Contentful that shows you how to integrate a third party API.

You can find the presentation files under /presentation.

Prerequisites

You will need:

  1. A Contentful account and space with at least a content type with a "description" text field and a "category" symbol field.

  2. A free API key for Dandelion.

Install

With the repo cloned/downloaded, you should start by running the following commands:

npm install
npm run login
npm run configure
npm start

How to use the repo

You can check out the commits to follow along step-by-step.

  1. Bootstrap

    The initial commit shows you the boilerplate code generated by the create-contentful-extension CLI. The choices made for the setup were "Field extension" type, "Symbol" field type, and "JavaScript" for the language.

  2. Forma 36 components

    This commit adds the React components needed for the custom UI extension. A text input to show the suggested category and a button for updating the category.

  3. External change handlers

    Updates the change handlers for keeping the "category" and "description" fields up-to-date. This is important e.g. when multiple people edit the same entry simultaneously.

  4. Style tweaks & CSS variables

    Tweaks the spacing between the components. This uses the pre-defined CSS variables imported from the @contentful/forma-36-tokens library.

  5. Integrate API

    Adds axios as a new dependency to make HTTP requests. Adds an installation parameter to pass the Dandelion API token to the UI extension. Integrates the Dandelion API to automatically predict the category based on the text in the "description" field.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.