get path of uploaded picture for custom parallax effect i created a custom block where i can upload an image. i overwrite the custom block with a template:

   &lt;div{{ attributes }}&gt;
  {{ title_prefix }}
  {% if label %}
    &lt;h2{{ title_attributes }}&gt;{{ label }}&lt;/h2&gt;
  {% endif %}
  {{ title_suffix }}
  {% block content %}
   &lt;div{{ content_attributes.addClass( 'content') }}&gt;

      &lt;div class="row"&gt;
        &lt;div class="col-md-12"&gt;

          {{content.field_parallax_bilder }}  &lt;----- (1)

          &lt;div class="parallax-window" data-parallax="scroll" data-image-src="(2)"&gt;  &lt;----- (2)

          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;/div&gt;

  {% endblock %}
&lt;/div&gt;


i want to get the path of the image (1) and include it in my data-image-src parameter (2). is there an easier way then write a block_preprocess?
You'll have to set a $src var from the corresponding preprocess hook. 

function myModuleOrTheme_preprocess_block(&amp;$variables){

if(isset($variables['elements']['content']['field_parralaxBgImage']))
//or any other way to test if you are in the right block

   //Get the Image id : 
   $imgListItems = $variables['elements']['content']['field_testimages']['#items'];
   $imgId = $imgListItems-&gt;getValue()[0]['target_id']; 
   //load the entity :
   $image = \Drupal\file\Entity\File::load($imageId);

  // now you can simply return the original image's url : 
  $variables['parralaxBgSrc'] = image-&gt;url();

  //or return a styled image's url (croped or resized) with a image style configured in the BO
  $imageStyle = \Drupal\image\Entity\ImageStyle::load('imageStyle_id');
  $variables['parralaxBgSrc'] = $imageStyle-&gt;buildUrl($image-&gt;getFileUri());

}


After that, you'll be able to use it in your twig tpl : 

 &lt;div class="parallax-window" data-parallax="scroll" data-image-src="{{$parralaxBgSrc}}"&gt; 


(Dont forgot to flush your cache after adding the hook) 

Et voila! :)