I have a problem and I can’t solve it myself at the moment: In a view, I output some fields of a content type (through id in the context filter) via "REST export". With this view, I would now also like to output css, js and the content of the of the rendered content in a field. For this I built a serializer plugin, where I render the respective content beforehand:
$nid = 36; $entity_type = 'node'; $view_mode = 'default'; $view_builder = Drupal::entityTypeManager()->getViewBuilder($entity_type); $storage = Drupal::entityTypeManager()->getStorage($entity_type); $node = $storage->load($nid); $build = $view_builder->view($node, $view_mode);
I have already loaded the libraries:
$theme = Drupal::theme()->getActiveTheme(); $lib = $theme->getLibraries();
Now I’m looking for what is output in the head on the page and the JS files below.