How can I use REST API through external php code?

I enabled all the restful services and rest api such that postman REST API requests work including "post" rest/node/article. However when I type up this code, I get an error 400: bad request and the drupal error logs claim that the error is because rest/node/article doesn't exist despite it working before. Please help.

<?php
use Drupal\Core\DrupalKernel;
use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Request;
$autoloader = require_once __DIR__ . '/vendor/autoload.php';
use GuzzleHttp\Client;

How can I update node's url path automatically?

I am using following code which is updating my node title fine but not URL PATH SETTING value.

// Update node.
$node_update = Node::load($node->id());
dpm($node_update);
$node_update->title->value = 'My modified title';
$node_update->path->value = ['alias' => '/en/my-new-link'];
$node_update->save();

Entity reference and embed view

Can someone explain to me what function it has entity reference and embed view? I' using Drupal 8.
Thanks for the help.

How to specify EntityReference in EntityForm wrapper

Working on a custom module, new to drupal. Using this method:

https://www.drupal.org/node/2071221

to submit an EntityForm from an external app through a drupal module. Saving the form triggers a rule. One of the form fields is an entity reference, the Entity object is used by the rule. How can I programatically populate this field prior to saving the form? Thanks in advance.

how to access hash marked and protected arrays in twig??

Hi all.
I am trying to use Kint dump from devel module and have 'paragraph' module installed.
I have a content type that uses several paragraphs as content types.
I can style both the individual fields from the paragraphs and the content at the node though I wish to add some html wrappers to the paragraph itself.
My tree
content type= clothing
clothing field=paragraph of type 'style' which has fields of stylename gender and images.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x