This is a drupal 8 contrib module allow you (developer) to find code examples.
Search content
On linux (wget)
wget --no-check-certificate https://yourdomain.com
wget --no-check-certificate https://name:pass@yourdomain.com
On Apache PHP
Examples with username and password:
https://name:pass@yourdomain.com
ftp://name:pass@yourdomain.com
​ftp://name:pass@ftp.yourdomain.com
ssh name:pass@yourdomain.com
Examples with username:
Crop images using convert (ImageMagick)
Example (Single file):
convert input.jpg -crop 1300x950+312+72 crop.jpg
convert input.jpg -crop 1300x950-100-50 crop.jpg
Form API :
$form['the_text_field']['#attributes']['class'][] = 'ctools-auto-submit-exclude';
OR
'#attributes' => array('class' => array('ctools-auto-submit-exclude')),
Views (using hook_form_alter)
In addition to the Step 2, Just add
$form['#cache']['disabled'] = TRUE;
$form['#cache']['max_age'] = 0;
Example 1. SASS (SCSS)
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
Example 2. SASS (SCSS)
Module Name = my_module
Content Type = my_new_content
Create content type
Put this two files into my_module/config/install/
Officiel Documentation :
https://api.drupal.org/api/drupal/core!modules!views!views.api.php/function/hook_views_data/8
Use multiple database conncetion with views_data()
For that you must add 'database
'
To show the Date / Time on Linux
date
To show the hardware Clock (RTC) on Linux
hwclock -r
OR
hwclock --show
OR show time in UTC (Coordinated Universal Time)
hwclock --show --utc
Examples of Available replacement patterns:
[title] ==
[body] == Body
[body-value] == Raw value
[body-summary] == Raw summary
[body-format] == Raw format
Enable debugging
You enable Twig Debugging in sites/default/services.yml.
(If services.yml does not yet exist; copy default.services.yml and rename it to services.yml.)
parameters:
twig.config:
debug: true
# Download latest stable release using the code below or browse to github.com/drush-ops/drush/releases.
# Example: drush 8.4.5
php -r readfile('https://github.com/drush-ops/drush/releases/download/8.4.5/drush.phar'); > drush
#OR
Example: Add/Remove 'test' Field depending on 'switch' field
Here an example for create a user account programmatically in Drupal 8
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();
$user = \Drupal\user\Entity\User::create();
Step 1. Create your module and Block (/tutoriels/107/create-a-simple-block-programmatically)
What are the best Free and multiplatform wireframe tools ?
1. Pencil Project
Link : http://pencil.evolus.vn/Default.html
Platforms : Windows, Mac Linux
2.Framebox
Link : http://framebox.org/
Platforms : Online
Example (basic)
drush migrate-upgrade --legacy-db-url=mysql://user:password@server/db --legacy-root=http://mydrupal6or7site.com
Example :
use Drupal\Component\Serialization\Json;
$json = Json::encode($data);
$data = Json::decode($json);
Example 1, with FieldPluginBase (\Drupal\views\Plugin\views\field\FieldPluginBase)
Site URL
1. Go to Administration > Configuration > Development > Performance
(/admin/config/development/performance)
2. Click on "Clear all caches"
Example:
1. in yourmodule.links.menu.yml
yourmodule.test:
title: Test
parent: system.admin_config_development
route_name: yourmodule.test
You can find any entity using Drupal 8 EntityQuery System.