Created
February 9, 2021 11:31
-
-
Save simesy/1f7963439e23cb365bf20e4156e01621 to your computer and use it in GitHub Desktop.
One liner to find something in your node output
This file contains 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
# If you want to find node pages with a string on them. Replace FINDME | |
# This is pretty intensive it will load and render all nodes in your site. | |
drush ev '$st = \Drupal::entityTypeManager()->getStorage("node"); $b= \Drupal::entityTypeManager()->getViewBuilder("node"); $ns = $st->loadMultiple(); foreach ($ns as $node) { print "FINDME " . $node->id() . "\n"; $built = $b->view($node, "default"); $o = \Drupal::service("renderer")->renderRoot($built); var_dump($o); }' | grep FINDME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment