I have 2 content bundles for node entity:
- Custom Layout Pages (custom_layout)
- Recipes (recipe)
Then I created two content using those content types, Potato (recipe) and Homepage (custom_layout).
I have 2 languages for both content, en and fr. I'm trying to load the potato recipe node inside of the homepage content.
So inside the preprocess hook, I have this code
...
if(isset($vars['node']) && $vars['node']->type === 'custom_layout'){
$recipe_id = 10;
$vars['recipe_side'] = render(node_view(node_load($recipe_id)));
}
...
Then I echo the $recipe_side in the custom_layout template file.
When I load the fr version of the page, I expected the recipe to be loaded in fr as well, but it always displays the en version.
I'm guessing it's because the en recipe node id is 10, and it doesn't load the translated node.
If that's the case, how can I make it work so that the loaded node follows the current language?