Score:0

CSS & JS from programmatically rendered node

us flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.