-
Install Drupal Console
-
Install PHP dependency
composer require league/html-to-markdown
- Copy content of
convert-html-markdown.php
to console/snippet/
# From your Google Spreadsheet, select the menu item Tools > Script editor. | |
# Copy and paste this code. | |
# Replace uuid with the build_hooks uuid from your Netlify project. | |
function onOpen() { | |
SpreadsheetApp.getUi() | |
.createMenu('Scripts') | |
.addItem('Build', 'build') | |
.addToUi(); | |
} |
<?php | |
function name_theme_preprocess_page() { | |
// ... | |
$variables['social_networks'] = theme_get_setting('social_networks', 'name_theme'); | |
} |
# Requires | |
# - DrupalConsole Launcher | |
# - Git | |
# - Composer | |
# - Sqlite | |
# | |
# How to use: | |
# copy the content of this gist to a new file name it as ~/.console/chain/try-umami-sqlite.yml | |
# | |
# Execution: |
Drupal 8 has changed a lot and the process of creating, building, testing and deploying a site is not the exception.
During this session, you will understand the process of creating, building, testing and deploying Drupal 8 sites, and learn which tools you can use to improve your local development workflow and reduce project setup and onboarding time, implement automated analysis tools for code review, code coverage and finally how to build an artifact and deploy your project.
<?php | |
/** | |
* Update the length of a text field which already contains data. | |
* | |
* @param string $entity_type_id | |
* @param string $field_name | |
* @param integer $new_length | |
*/ | |
function _module_change_text_field_max_length ($entity_type_id, $field_name, $new_length) { |
<?php | |
/** | |
* Update field data table and configuration storage | |
*/ | |
function _update_field_data( | |
$entityType, | |
$field, | |
$valueMapping, |
<?php | |
function _update_table_field($fieldName, $valueMapping) { | |
$schema = \Drupal::database()->schema(); | |
$tables = $schema->findTables('%'); | |
foreach ($tables as $table) { | |
if ($schema->fieldExists($table, $fieldName)) { | |
foreach ($valueMapping as $originalValue => $newValue) { | |
echo sprintf( | |
'Updating table %s and field %s from %s to %s', |