-
Install Drupal Console
-
Copy content of
add-file-image-as-media-image.php
to console/snippet/ -
Execute drupal console
snippet
command
drupal snippet --file=console/snippet/add-file-image-as-media-image.php
export const query = graphql` | |
query($slug: String!) { | |
site { | |
siteMetadata { | |
domain | |
} | |
} | |
allSiteSettingEntitySite { | |
edges { | |
node { |
import React from 'react' | |
import { StaticQuery, graphql } from 'gatsby' | |
import Layout from '../components/templates/layout' | |
import Home from '../components/templates/home' | |
const dateFormat = require('date-fns/format') | |
const IndexPage = () => ( | |
<StaticQuery | |
query={graphql` |
<?php | |
declare(strict_types = 1); | |
namespace Drupal\module_name\Plugin\jsonapi\FieldEnhancer; | |
use Drupal\Component\Render\PlainTextOutput; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
use Drupal\Core\Utility\Token; | |
use Drupal\jsonapi_extras\Plugin\ResourceFieldEnhancerBase; |
<?php | |
namespace Drupal\module_name\Plugin\jsonapi\FieldEnhancer; | |
use Drupal\Core\Url; | |
use Drupal\jsonapi_extras\Plugin\ResourceFieldEnhancerBase; | |
use Shaper\Util\Context; | |
/** | |
* Use alias for internal link field value. |
<?php | |
$nodeManager = \Drupal::entityTypeManager()->getStorage('node'); | |
$nodes = \Drupal::entityTypeManager() | |
->getStorage('node') | |
->loadByProperties([ | |
'type' => 'landing' | |
]); |
# 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: |
Create file at ~/console/chain/generate-controller-form-render.yml
containing:
command:
name: 'generate:controller:form:render'
description: 'Controller + Form generator'
commands:
- command: 'generate:module'
options:
module: example
This script run the following tasks on multiple repos from the CLI.
phar
file. (only for drupal-console-launcher
)phar
file (only for drupal-console-launcher
)