/* globals MY_GLOBAL */
This file contains hidden or 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
| # Install Homebrew | |
| 1. xcode-select --install | |
| 2. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| # http://mxcl.github.com/homebrew | |
| # | |
| # https://github.com/mxcl/homebrew | |
| # https://github.com/mxcl/homebrew/wiki | |
| # http://matthewcarriere.com/2013/08/05/how-to-install-and-use-homebrew/ |
This file contains hidden or 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
| # https://docs.designhammer.net/cms/drush/ | |
| # From your home dir. | |
| # download | |
| $ curl -sS https://getcomposer.org/installer | php | |
| # move file | |
| $ mv composer.phar /usr/local/bin/composer | |
| # install cgr globally (may not be needed) |
This file contains hidden or 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
| <div class="block-views-blockresults-node-blocks-block-2"> | |
| <h2>Title</h2> | |
| {# view name block name #} | |
| {{ drupal_view('results_node_blocks', 'block_2') }} | |
| </div> |
This file contains hidden or 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
| To get media uri, make sure view mode for field is set to "rendered entity" | |
| ```twig | |
| {% set background_image_uri = file_url(content.field_photo_cta_photo[0]['#media'].field_media_image.entity.uri.value) %} | |
| ``` | |
| Get the media path in a view twig template |
Disable Drupal 8 caching during development
- Copy and rename:
- sites/example.settings.local.php --> sites/default/settings.local.php
- uncomment the following lines (search for it):
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
$settings['cache']['bins']['render'] = 'cache.backend.null';
This file contains hidden or 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 | |
| if (isset($log_entry['variables']) && !is_array($log_entry['variables'])) { | |
| print json_encode(debug_backtrace()); | |
| } |
This file contains hidden or 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 | |
| /** | |
| * | |
| * http://josephfitzsimmons.com/creating-a-hero-page-template-in-drupal/ | |
| * | |
| */ | |
| // template.php |
This file contains hidden or 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 | |
| // in search results | |
| $physician_nid = $result['node']->nid; | |
| $path = 'node/' . (int) $physician_nid; | |
| $alias = drupal_get_path_alias($path); | |
| print '<a href="' . $alias . '">Physician Profile</a>'; |
This file contains hidden or 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
| //Override default local database settings | |
| $databases = array ( | |
| 'default' => | |
| array ( | |
| 'default' => | |
| array ( | |
| 'database' => 'database_local', | |
| 'username' => 'root', | |
| 'password' => 'root', | |
| 'host' => 'localhost', |