In the HKNA project, i exposed a flag in a view but it turns on the available option names are True and False instead of Yes and No.
Since version 4.1, CKEditor introduced the Advanced Content Filter(ACF) which limits some HTML tags so as to match the editor configuration in the best possible way. But that’s really annoying to me.
Sometimes you may have 2 different modules implementing hook_form_alter() on the same form. In that case, the order of the module execution would follow the alphabetic order of the module name. If you want to alter the execution order, you could either update the system table in database or install the Modules Weight module.
1. Download and install the Modules Weight.
After enabling the Cache blocks option @ admin/config/development/performance, the form inside a custom block throws the following error.
- The form has become outdated. Copy any unsaved work in the form below and then reload this page.
One work around is to disable cache for that specific custom block and this could be done by adding the DRUPAL_NO_CACHE in your hook_block_info().
In the previous posts, we have gone through some examples about working with Drupal 8 RESTful web service.
- Drupal 8 – Setup the RESTful Service @ 1
- Connect Drupal 8 RESTful Service with Guzzle PHP Web Service Client @ 1
- Drupal 8 – Login in Guzzle Web Service Client @ 1
We can also add node to Drupal through web service. But as i mentioned before, the RESTful feature is not fully completed so we can only create a node with a title. Here is a example web service client in PHP using Guzzle.
1. Get your PHP client ready by following my previous post.
2. Update your index.php as follow.
<?php require 'vendor/autoload.php'; use Guzzle\Http\Client; use Guzzle\Plugin\Cookie\CookiePlugin; use Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar; $cookiePlugin = new CookiePlugin(new ArrayCookieJar()); $client = new Client('http://drupal8.localhost.com'); $client->addSubscriber($cookiePlugin); $request = $client->post('user', null, array( 'name' => '<username>', 'pass' => '<password>', 'form_id' => 'user_login_form', )); $request->addHeader('Accept', 'application/json'); $response = $request->send()->json(); print '<pre>'; print_r($response); print '</pre>'; ?>
Previously I have setup a a Drupal 8 which is RESTful ready.
Guzzle is a PHP HTTP client & framework for building RESTful web service clients. In this example, we would create a simple .php to fetch a node from Drupal 8.
1. Make sure you have the Composer installed. You can refer to my previous post.
After studying Drupal 8 for a few days, i got the feeling that there are still a lot of works to polish it before a beta or RC release. And lacking documentation is another big problem to kick start with Drupal 8. This post may help you to get some simple idea on how to setup RESTful service in Drupal 8 but very likely, the details will change in the future.
1. Enable the RESTful Web Services.
It’s time to get start with Drupal 8! The biggest change in this major update is that Drupal 8 is now with the Symfony PHP framework. So Drupal developer could work with those components such as ClassLoader, Routing and DependencyInjection which are provided by the Symfony framework.
Ok! Stop talking and start coding~ =D
Drupal is an open source Content Management System (CMS) and in this 2 hours workshop, we will go through the basic concepts on working with Drupal including Content Type, Node, Block, Module and Theme.
This class is a stepping stone for you to get into the Drupal world. Whether you are web developer, an entrepenuer or a project manager, by understanding the Drupal habitat, you will be able to consider whether Drupal is fit for your career, your business or your project.
Hope to see you there~ =)
21st Floor, The Phoenix Building
No.23 Luard Road