Skip to content

Instantly share code, notes, and snippets.

@ahgood
Created August 9, 2017 02:03
Show Gist options
  • Save ahgood/137728e3772df4c7785b85329a64ee8f to your computer and use it in GitHub Desktop.
Save ahgood/137728e3772df4c7785b85329a64ee8f to your computer and use it in GitHub Desktop.
//Disable cache
//https://www.drupal.org/node/2598914
//https://www.drupal.org/project/devel
//Update Drupal Core
//https://www.drupal.org/node/2550801
drush pm-update drupal
//Get all taxonomy
//Sites/devdesktop/drupal-8.3.5/core/themes/bartik/bartik.theme
function bartik_preprocess_page(&$variables) {
$name = '';
$terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadMultiple();
foreach ($terms as $term) {
$tid = $term->id();
$vid = $term->getVocabularyId();
$name .= $term->getName();
}
$variables['taxo'] = $name . 'test';
$variables['tids'] = implode(" ", \Drupal::entityQuery('taxonomy_term')->execute());
}
//Sites/devdesktop/drupal-8.3.5/core/themes/bartik/templates/page.html.twig
{{ taxo }} | {{ tids }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment