All Projects → mgschoen → contentful-reference-matrix-field-app

mgschoen / contentful-reference-matrix-field-app

Licence: other
Contentful App that adds UI for a table-like list of references with other associated data.

Programming Languages

typescript
32286 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to contentful-reference-matrix-field-app

create-contentful-app
Bootstrap a Contentful App
Stars: ✭ 68 (+142.86%)
Mutual labels:  contentful, contentful-app
cf-content-types-generator-app
A Contentful App to generate typescript types based on contentful's content types.
Stars: ✭ 28 (+0%)
Mutual labels:  contentful, contentful-app
Nalgebra
Linear algebra library for Rust.
Stars: ✭ 2,433 (+8589.29%)
Mutual labels:  matrix
Tmatrix
Terminal based replica of the digital rain from The Matrix.
Stars: ✭ 227 (+710.71%)
Mutual labels:  matrix
Correlation
🔗 Methods for Correlation Analysis
Stars: ✭ 192 (+585.71%)
Mutual labels:  matrix
Ugm
Ubpa Graphics Mathematics
Stars: ✭ 178 (+535.71%)
Mutual labels:  matrix
Peroxide
Rust numeric library with R, MATLAB & Python syntax
Stars: ✭ 191 (+582.14%)
Mutual labels:  matrix
Dendrite
Dendrite is a second-generation Matrix homeserver written in Go!
Stars: ✭ 2,758 (+9750%)
Mutual labels:  matrix
Syphon
⚗️ a privacy centric matrix client
Stars: ✭ 245 (+775%)
Mutual labels:  matrix
Etl
Blazing-fast Expression Templates Library (ETL) with GPU support, in C++
Stars: ✭ 190 (+578.57%)
Mutual labels:  matrix
Maubot
A plugin-based Matrix bot system.
Stars: ✭ 226 (+707.14%)
Mutual labels:  matrix
Github Matrix
The GitHub Matrix
Stars: ✭ 187 (+567.86%)
Mutual labels:  matrix
Decomposed
CATransform3D manipulation made easy.
Stars: ✭ 184 (+557.14%)
Mutual labels:  matrix
Android 3d Layout
Wow effect, transform your layout into 3D views
Stars: ✭ 199 (+610.71%)
Mutual labels:  matrix
Phpsci Carray
PHP library for scientific computing powered by C
Stars: ✭ 176 (+528.57%)
Mutual labels:  matrix
Nio
💬 Nio is an upcoming matrix client for iOS.
Stars: ✭ 235 (+739.29%)
Mutual labels:  matrix
Mautrix Facebook
A Matrix-Facebook Messenger puppeting bridge
Stars: ✭ 172 (+514.29%)
Mutual labels:  matrix
Md max72xx
LED Matrix Library
Stars: ✭ 186 (+564.29%)
Mutual labels:  matrix
Mxisd
Federated Matrix Identity Server
Stars: ✭ 194 (+592.86%)
Mutual labels:  matrix
Pygraphblas
GraphBLAS for Python
Stars: ✭ 252 (+800%)
Mutual labels:  matrix

Contentful Reference Matrix Field App

This Contentful App adds a custom UI that represents a list of references with some associated plain text – such as a list of recipe ingredients with the respective amounts.

Inspired by this video and bootstrapped with Create Contentful App.

Functionality overview

  • Can be used on JSON Object fields
  • Adds a table-like UI with an entry selection modal
  • Produces data in the form of an array of JSON objects
  • Each object represents a tuple of
    • a relation to another entry
    • some arbitrary text
  • Items can be sorted via drag and drop
  • The following things can be configured:
    • JSON keys
    • Allowed content types for referenced entries
    • Label for the text field

Example Data structure

The data produced by the reference matrix field type looks something like this:

[
    {
        "amount": "2 tbsp",
        "id": "4skkkYCvbdHVhRfI5hdW7o"
    },
    {
        "amount": "3 tsp",
        "id": "2xFnDNGBloZzp59kddJBI6"
    },
    {
        "amount": "200g",
        "id": "2uqKK4iWHxhlRrGn24OLvy"
    }
]

In this example, id represents a relation to an entry.

amount is an unformatted string holding additional information about the reference.

Note that both JSON keys can be configured, as well as the allowed content types for referenced entries.

Setup for Usage in Contentful

(1) Build your app with $ npm run build and host the files found in ./build/ somewhere statically.

(2) In your Contentful account, create a new private app. Give it a name and enter the URL that points to the hosted version of your ./build/ directory.

(3) Under "Location", check "Entry field" and "JSON Object"

(4) Under "Instance Parameter Defintions", add four instance parameters with the following IDs, each of them of type "Short text":

  • referenceKey
  • textKey
  • textLabel
  • contentTypes

(5) Save the app and install it to the space(s) you like.

(6) When you add or edit a JSON Object field in your content model, you should now see your app in the "Appearance" tab, along with fields for the instance parameters you configured. Fill them out as follows:

Parameter Description Default
referenceKey  the JSON key used for storing the referenced entry's id  "id" 
textKey  the JSON key used for storing the associated text  "text" 
textLabel  used as a placeholder for the text input fields  "Text" 
contentTypes  a comma separated list of content types that can be referenced (empty means all content types allowed)  "" 

Development

In the project directory, you can run:

npm start

Creates or updates your app definition in contentful, and runs the app in development mode. Open your app to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

npm run build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes. Your app is ready to be deployed!

More about Contentful Apps

Read more and check out the video on how to use the CLI.

Create Contentful App uses Create React App. You can learn more in the Create React App documentation and how to further customize your app.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].