MEH-Design / frix

A CMS based on atomic design principles.
MIT License
2 stars 1 forks source link

API - getContentStructure #50

Closed MiniXC closed 8 years ago

MiniXC commented 8 years ago

getContentStructure

Gets the content JSON, including additional data types. Takes the page url (e.g. /page1) as an argument.

Each value get's an additional type attribute.

example

let contentData = {
  "title" : {
    type: "text",
    value: "Woody"
  },
  "article" : {
    "text": {
      type: "richtext",
      value: "A tree is a tall plant with a trunk and branches made of wood."
    },
    "header": {
      "heading-en": {
        type: "text",
        value: "Tree"
      },
      "heading-de": {
        type: "text",
        value: "Baum"
      },
      "author": {
        "name": {
          type: "text",
          value: "Wikipedia"
        },
        "link": {
          type: "url",
          value: "https://simple.wikipedia.org/wiki/Tree"
        }
      }
    }
  }
};
MiniXC commented 8 years ago

Was done in 7735e752f8de97fa29400e115ab50d64d3eeb081.