Print image from filepath in Twig
For example if your default image called default_img.png inside images folder inside your theme MyTheme.

You can try the following:


implement hook_preprocess_HOOK




/**
 2. Implements hook_preprocess_HOOK().
 */
function extended_url_preprocess_paragraph(&$variables) {
  $variables['theme_path'] = drupal_get_path('theme', 'MyTheme');
}




In your twig you can do something like:


{% if content.field_image|render = true %}  
    {{ content.field_image }}  
{% else %}  
&lt;img src="{{ theme_path ~ directory }}/images/default_img.png"/&gt;
{% endif %}