W
orking in code using both php and twig is tricky.
In this article we show some code snippets about how to use code related field image.
Get image source and alt fields
img_src: file_url(content.field_image.entity.fileuri)
img_alt: content.field_image.0['#item'].alt
Show block programatically
https://drupal.stackexchange.com/questions/171686/how-can-i-programmatically-display-a-block
Show view programatically
- https://pixelthis.gr/content/drupal-8-views-render-view-programmatically
- https://befused.com/drupal/drupal-8-view-embed/
Get data from node and paragraphs
https://webdev.iac.gatech.edu/blog/drupal8_render_twig