Note: you must have <?php
at the beginning of the script.
lando drush scr ./myscript
*Note: you must LEAVE OUT `
name: Edit This Node | |
description: Adds a button to the toolbar to edit the current node. It will say "New Draft" if using moderation. | |
package: Custom | |
type: module | |
version: 1.0 | |
core: 8.x |
<?php | |
// get node types | |
$node_types = \Drupal::entityTypeManager() | |
->getStorage('node_type') | |
->loadMultiple(); | |
$entityManager = \Drupal::service('entity_field.manager'); | |
// for each content type, get the text_long fields for that content type |
<?php | |
use Drupal\paragraphs\Entity\Paragraph; | |
// get node types | |
$node_types = \Drupal::entityTypeManager() | |
->getStorage('node_type') | |
->loadMultiple(); | |
$entityManager = \Drupal::service('entity_field.manager'); |
<?php | |
use Drupal\paragraphs\Entity\Paragraph; | |
$field_containing_paragraph = 'field_my_field'; | |
$paragraph_type_to_find = 'my_paragraph'; | |
$query = \Drupal::entityQuery('node'); | |
$node_ids = $query | |
->condition('status', 1) |
<?php | |
use Drupal\paragraphs\Entity\Paragraph; | |
$field_name = 'field_my_field'; | |
$query = \Drupal::entityQuery('node'); | |
$node_ids = $query | |
->condition('status', 1) | |
->exists($field_name) |
<?php | |
use Drupal\taxonomy\Entity\Term; | |
ini_set('auto_detect_line_endings', TRUE); | |
$rows = array_map('str_getcsv', file('./scripts/media/taxonomy.csv')); | |
$header = array_shift($rows); | |
$csv = array(); | |
foreach ($rows as $row) { |
- List nodes w/o aliases | |
SELECT nid, type FROM node WHERE nid NOT IN ( | |
SELECT SUBSTR(source, 7) FROM url_alias WHERE source LIKE '/node/%' | |
); | |
- List nodes w/o aliases and group by content type | |
SELECT nid, type FROM node WHERE nid NOT IN ( | |
SELECT SUBSTR(source, 7) FROM url_alias WHERE source LIKE '/node/%' |
{ | |
"name": "my_site", | |
"version": "1.0.0", | |
"description": "My Site", | |
"main": "index.js", | |
"scripts": { | |
"dev": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"development": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"watch": "NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"hot": "NODE_ENV=development webpack-dev-server --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", |
<?php | |
$xml_files = glob("./POC_LO_SET/*.xml"); | |
print "starting" . "\n"; | |
$overall_count = array(); | |
//$amount_to_try = 2; | |
foreach ($xml_files as $file) { |