Skip to content

Commit 406fba2

Browse files
committed
Update README
1 parent db619bd commit 406fba2

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

README.md

+27-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
1-
# Data Types with post_content and post meta
1+
# Data Types with content areas
22

3-
`npm install` and `npm run dev-server`
3+
Run it with `npm install` and `npm run dev-server`.
44

5-
### TODO
5+
## How it works
66

7-
- [ ] Document stuff better and show teammates
8-
- [ ] Lock all content and styling except bound blocks's inside when entering data
9-
- [ ] Work on examples that have a primary and secondary content
7+
### Creating a data type
8+
9+
Much like the Hackathon, the Editor creates a new post type and define the fields.
10+
11+
The "fields" in this prototype are limited to the content areas.
12+
13+
When you select a Group block, a new inspector control ("Content area") is added to the sidebar,
14+
where you can bind the contents to a specific part of the post object.
15+
16+
- `post_content` binds to the `post_content` attribute.
17+
- Any other value binds to the post meta fields.
18+
19+
### Entering data
20+
21+
The data type template and displayed in the Editor. User enters content in the group blocks that were added.
22+
23+
Upon clicking "Save", the back-end will intercept the post, extract the bound Group's contents and
24+
route them to the appropriate places.
25+
26+
### Displaying data
27+
28+
The `post_content` is not intercepted, and the stored content is displayed.
29+
30+
The plugin creates a block variation for each post meta field, and also exposes a block that renders the data type template.

inc/content-area-binder.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function registerContentAreaInspector( wp ) {
2323
wp.element.createElement(
2424
PanelBody,
2525
{
26-
title: 'Content Area',
26+
title: 'Content area',
2727
initialOpen: true,
2828
},
2929
[

0 commit comments

Comments
 (0)