Created
December 7, 2018 18:49
-
-
Save omarlopesino/a1899377a02dc6b01faa78bf11416cd6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$paragraph_text = Paragraph::create([ | |
'type' => 'text', | |
'field_text' => [ | |
'value' => ' | |
<h2>In this page you can publish the failures you consider people might learn of.</h2> | |
<p><a class="btn btn-primary text-center" href="/node/add/failure" title="Post your own failure!">Post your own failure!</a></p> | |
', | |
'format' => 'restricted_html' | |
], | |
]); | |
$paragraph_text->save(); | |
$paragraph_block = Paragraph::create([ | |
'type' => 'block', | |
'field_block' => [ | |
'plugin_id' => 'views_block:learnfailing_failure_list-block_1', | |
'settings' => [], | |
], | |
]); | |
$paragraph_block->save(); | |
$node = Node::create([ | |
'type' => 'page', | |
'uid' => 1, | |
'title' => 'Welcome!', | |
'field_bricks' => [ | |
[ | |
'depth' => 0, | |
'options' => NULL, | |
'target_id' => $paragraph_text->id(), | |
], | |
[ | |
'depth' => 0, | |
'options' => NULL, | |
'target_id' => $paragraph_block->id(), | |
], | |
], | |
]); | |
$node->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment