Skip to content

Instantly share code, notes, and snippets.

View bySebastian's full-sized avatar

Sebastian Vyaene bySebastian

View GitHub Profile
@bySebastian
bySebastian / bamboo-drupal
Created December 5, 2017 06:47
[bamboo] Drupal extensions Twig #drupal
# https://www.drupal.org/docs/8/modules/bamboo-twig/usage
Bamboo Twig has a lot of advantages and brings a lot of new features to the Twig landscape of Drupal 8.
It boosts performance by using lazy loading, improves the code quality with automated workflow.
It's excepted that Bamboo Twig will normalize the way you use twig in your Drupal project reducing the need to install a bunch of extra modules.
Internationalization
@bySebastian
bySebastian / drupal-twig-tweak
Created November 30, 2017 16:07
[Twig tweak] Cheat sheet #drupal
<dl class="examples">
{# This accepts views arguments as well. #}
<dt>View:</dt>
<dd>{{ drupal_view('who_s_new', 'block_1') }}</dd>
{# The block should be configured on "admin/structure/block" page. #}
<dt>Block:</dt>
<dd>{{ drupal_block('system_powered_by_block') }}</dd>
@bySebastian
bySebastian / drupal-available-variables
Created November 29, 2017 10:04
[available variables] Dump available variables #drupal
# To dump only the available variable keys use:
{{ dump(_context|keys) }}
<ol>
{% for key, value in _context %}
<li>{{ key }}</li>
{% endfor %}
</ol>
@bySebastian
bySebastian / drush-disable module
Last active November 30, 2017 09:14
[modules] install / enable / disable modules #drush
# Disable Drupal module
drush pm_uninstall module_name
@bySebastian
bySebastian / drupal-site-mode-dev
Last active November 28, 2017 10:47
[site-mode] Set working environment Drupal site #drupal
# 1. Ensure the local copy is using a sites/default/settings.local.php, and that it is being included by the sites/default/settings.php file.
# 2. Copy sites/development.services.yml to sites/default/services.yml. The services.yml file is ignored by Git by default, and contains environment-specific settings.
# 3. Ensure the permission of the sites/default/services.yml file allow you to read/write, as when you run Drupal cConsole's "site:mode" command, the file will be modified.
# 4. Run Drupal Console's "site:mode" command to put the site in development mode.
drupal site:mode dev
@bySebastian
bySebastian / drush-cache-rebuild
Last active November 28, 2017 07:29
[cache-rebuild] rebuild all cache #drush
drush cache-rebuild
@bySebastian
bySebastian / drupal-drush
Last active November 28, 2017 07:28
[config-export] export complete config #drush
drush config-export