Skip to content

Instantly share code, notes, and snippets.


Mike Crittenden mikecrittenden

View GitHub Profile
mikecrittenden / get_node_by_path.php
Created Sep 16, 2016 — forked from thagler/get_node_by_path.php
Drupal 8 Get node ID by path alias
View get_node_by_path.php
$path = \Drupal::service('path.alias_manager')->getPathByAlias('/this-is-the-alias');
if(preg_match('/node\/(\d+)/', $path, $matches)) {
$node = \Drupal\node\Entity\Node::load($matches[1]);
mikecrittenden /
Created Aug 10, 2016 — forked from mirie/
P2 PR Template Draft (Drupal Project)

Definition of Done:

This section is for your verification before submitting a PR. Remove this before submitting:

  • Has any required automated testing been written/updated?
  • Has the documentation been added/updated?
  • Is there appropriate logging included?
  • Does this add new modules/themes? If so:
    • Has the make file been updated?
    • Has the install profile's info file been updated?
    • Have you run a test build locally to confirm your new modules/themes get downloaded and enabled properly?
  • Does this add new configuration? If so: