parameters:
twig.config:
# Twig debugging:
#
# When debugging is enabled:
# - The markup of each Twig template is surrounded by HTML comments that
# contain theming information, such as template file name suggestions.
# - Note that this debugging markup will cause automated tests that directly
# check rendered HTML to fail. When running automated tests, 'twig_debug'
# should be set to FALSE.
# - The dump() function can be used in Twig templates to output information
# about template variables.
# - Twig templates are automatically recompiled whenever the source code
# changes (see twig_auto_reload below).
#
# For more information about debugging Twig templates, see
# http://drupal.org/node/1906392.
#
# Not recommended in production environments
# @default false
debug: true
# Twig auto-reload:
#
# Automatically recompile Twig templates whenever the source code changes.
# If you don't provide a value for twig_auto_reload, it will be determined
# based on the value of twig_debug.
#
# Not recommended in production environments
# @default null
auto_reload: true
# Twig cache:
#
# By default, Twig templates will be compiled and stored in the filesystem
# to increase performance. Disabling the Twig cache will recompile the
# templates from source each time they are used. In most cases the
# twig_auto_reload setting above should be enabled rather than disabling the
# Twig cache.
#
# Not recommended in production environments
# @default true
cache: false
factory.keyvalue:
{}
# Default key/value storage service to use.
# @default keyvalue.database
#default: keyvalue.database
# Collection-specific overrides.
#state: keyvalue.database
factory.keyvalue.expirable:
{}
# Default key/value expirable storage service to use.
# @default keyvalue.database.expirable
#default: keyvalue.database.expirable
parameters:
twig.config:
# Twig debugging:
#
# When debugging is enabled:
# - The markup of each Twig template is surrounded by HTML comments that
# contain theming information, such as template file name suggestions.
# - Note that this debugging markup will cause automated tests that directly
# check rendered HTML to fail. When running automated tests, 'twig_debug'
# should be set to FALSE.
# - The dump() function can be used in Twig templates to output information
# about template variables.
# - Twig templates are automatically recompiled whenever the source code
# changes (see twig_auto_reload below).
#
# For more information about debugging Twig templates, see
# http://drupal.org/node/1906392.
#
# Not recommended in production environments
# @default false
debug: true
# Twig auto-reload:
#
# Automatically recompile Twig templates whenever the source code changes.
# If you don't provide a value for twig_auto_reload, it will be determined
# based on the value of twig_debug.
#
# Not recommended in production environments
# @default null
auto_reload: true
# Twig cache:
#
# By default, Twig templates will be compiled and stored in the filesystem
# to increase performance. Disabling the Twig cache will recompile the
# templates from source each time they are used. In most cases the
# twig_auto_reload setting above should be enabled rather than disabling the
# Twig cache.
#
# Not recommended in production environments
# @default true
cache: false
factory.keyvalue:
{}
# Default key/value storage service to use.
# @default keyvalue.database
#default: keyvalue.database
# Collection-specific overrides.
#state: keyvalue.database
factory.keyvalue.expirable:
{}
# Default key/value expirable storage service to use.
# @default keyvalue.database.expirable
#default: keyvalue.database.expirable
Text
Text
create settings.local.php
settings.php
<?php
/**
* Implements hook_preprocess_node
*/
function matt_preprocess_node(&$vars) {
if ($vars['node']->getType() === 'article') {
$unformatted_date = $vars['node']->getCreatedTime();
$vars['date'] = format_date($unformatted_date, 'custom', 'M d, Y');
}
}
<?php
/**
* Add jquery
*/
function matt_page_alter(&$page) {
$page['#attached']['library'][] = 'core/jquery';
}
(deprecated for hook_page_attachments)
themes/theme_name/theme_name.libraries.yml
matt-corescripts:
version: VERSION
js:
js/modernizr.custom.04204.js: {}
themes/theme_name/theme_name.theme
<?php
/**
* Add custom scripts
*/
function matt_page_alter(&$page) {
$page['#attached']['library'][] = 'matt/matt-corescripts';
}
(deprecated for hook_page_attachments)
<?php
/**
* Implements hook_page_attachments_alter().
*/
function hook_page_attachments_alter(array &$page)
{
$page['#attached']['css'][] = array(
'type' => 'external',
'data' => '//fonts.googleapis.com/css?family=Open+Sans',
'every_page' => TRUE,
);
}
themes/theme_name/theme_name.theme
{% if display_submitted %}
<footer class="node__meta">
{{ author_picture }}
<div{{ author_attributes.addClass('node__submitted') }}>
{% trans %}Submitted by Matt on {{ date|passthrough }}{% endtrans %}
{{ metadata }}
</div>
</footer>
{% endif %}
name: Matthew
description: A simple hello world module.
core: 8.x
package: Custom
type: module
<?php
/**
* @file
* Code for the matthew.module.
*/
function matthew_page_alter(&$page) {
drupal_set_message('Hello world');
}
drush @yoursite.local config-export
git add -f sites/default/files/config_wNOLcmycPFZCrXJ9wis9dCdSR4lpYILdBsFxSWuK5Hzhcr-irILQ0u25dfasd9sdfsadWaUDwMg
git commit -m 'Exporting configuration to code.'
git push origin master
drush @yoursite.production config-import
use homebrew
use apt-get
use yum