I have content type A. It has field reference to content type B.
I'm rendering referenced node B from content type A twig template like:
{{ content.field_referenced_object }}
And that works well.
I also render some type A filed inside it's template like:
{{ content.field_some }}
which also works.
Problem is that I need that field_some
value to be displayed from referenced object B template instead of object A template, to optimize page markup. How can I pass value from content type A twig template to content type B twig template?
It twig it can be done when including template like:
{% include 'template.html' with {'foo': 'bar'} %}
But is there some analogy for Drupal 8 theming?