This file contains 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
function some_theme_preprocess_paragraph(&$variables) { | |
$element = &$variables['elements']; | |
$paragraph = $variables['paragraph']; | |
if ($paragraph->getType() === 'image_gallery') { | |
$images = $paragraph->get('field_image_gallery'); | |
foreach ($images->referencedEntities() as $image) { | |
$image->parent_paragraph = $paragraph; | |
} | |
} |
This file contains 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
Array | |
( | |
[uuid] => d0e01c96-4fe9-491d-8a00-f42e3b84465e | |
[langcode] => en | |
[status] => 1 | |
[dependencies] => Array | |
( | |
[config] => Array | |
( | |
[0] => field.field.node.page.body |
This file contains 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 | |
function mymodule_update_9001(&$sandbox) { | |
// Initialize variables on the first run. | |
if (!isset($sandbox['total'])) { | |
$entity_list = \Drupal::entityQuery('node') | |
->condition('type', 'my_entity') | |
->execute(); | |
$langcodes = \Drupal::languageManager()->getLanguages(); | |
$sandbox['langcodes'] = array_keys($langcodes); |
This file contains 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 | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\paragraphs\Entity\ParagraphsType; | |
/** | |
* Implements hook_form_alter(). | |
*/ | |
function example_form_form_alter(&$form, FormStateInterface $form_state, $form_id) { | |
$form_ids = [ |
This file contains 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 | |
namespace Drupal\sandbox\Form; | |
use Drupal\Core\Form\FormBase; | |
use Drupal\Core\Form\FormInterface; | |
use Drupal\Core\Form\FormState; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\node\Entity\Node; | |
use Drupal\user\Entity\User; |
This file contains 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
lando drush sql-query "DELETE FROM key_value WHERE collection='system.schema' AND name in ('search_api_views_taxonomy');" |
This file contains 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
; Ender 3 Custom Start G-code | |
G92 E0 ; Reset Extruder | |
G28 ; Home all axes | |
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed | |
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position | |
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line | |
G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little | |
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line | |
G92 E0 ; Reset Extruder | |
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed |
This file contains 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
$build['view'] = [ | |
'#type' => 'view', | |
'#name' => 'hero_image', | |
'#display_id' => 'block_1', | |
'#arguments' => [ | |
107793, | |
], | |
]; |
This file contains 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
#!/bin/bash | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
NewerOlder