I have a page(node) with a certain ID. On the front page, I want to pull a field called field_image1 and field_link1.
To do that I added the following to my themename.theme:
use Drupal\node\Entity\Node;
function themename_preprocess_nodethemename_preprocess_page(&$variables) {
$vanilla_spice$variables['vanilla_spice'] = Node::load(61);
$variables['variable'] = "tetsing the variable";
}
page--front.html.twig:
{{ kint(vanilla_spice) }}
{{ kint(variable) }}
When I visit the page, the variable is null :(
How can I load this information inside the variable?
Note: I based myself in this answer here, but even if I assign a normal string to the vanilla_spice variable
$vanilla_spice = "tetsing the variable";
I still see a null.