Nodes
Last updated on
11 March 2021
This documentation needs work. See "Help improve this page" in the sidebar.
Below are various examples and helpful snippets for defining content using the 1.x branch of the YAML Content module. While the structure for the content may be very similar to that of the 2.x branch, changes to the handling for dynamic processing make direct usage between the two versions unlikely to work.
Create a Basic Node
# Add a basic article page with simple values.
- entity: "node"
type: "article"
title: "Basic Article"
status: 1
# Rich text fields contain multiple keys that must be provided.
body:
- format: "full_html"
# Using a pipe we can define content across multiple lines.
value: |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vobis voluptatum perceptarum recordatio vitam beatam facit, et quidem corpore perceptarum. Tum Quintus: Est plane, Piso, ut dicis, inquit.</p><p>Primum cur ista res digna odio est, nisi quod est turpis? Duo Reges: constructio interrete. Rhetorice igitur, inquam, nos mavis quam dialectice disputare?</p>Create a Basic Node with (Moderation State Status)
# Add a basic article page with simple values.
- entity: "node"
type: "article"
title: "Basic Article"
status: 1
# Text value of what default 'published' status one sets up in the CMS.
moderation_state:
value: 'published'
# Rich text fields contain multiple keys that must be provided.
body:
- format: "full_html"
# Using a pipe we can define content across multiple lines.
value: |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vobis voluptatum perceptarum recordatio vitam beatam facit, et quidem corpore perceptarum. Tum Quintus: Est plane, Piso, ut dicis, inquit.</p><p>Primum cur ista res digna odio est, nisi quod est turpis? Duo Reges: constructio interrete. Rhetorice igitur, inquam, nos mavis quam dialectice disputare?</p>Help improve this page
Page status: Needs work
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion