1

I'm using webform_multiple_file. To display my submissions, I created a view and added as field Webform submission data: Value

To customize my view I used print $fields['value_1']->content ;

This displays somthing like this:

image1.png

image2.jpeg

But I want to display just the first data and as an image like

<img src="image1.png" />

Below the HTML return

<div class="webform-multiple-file"><a href="http://localhost/mydrupal/sites/default/files/webform/image1.png">image1.png</a></div><div class="webform-multiple-file"><a href="http://localhost/mydrupal/sites/default/files/webform/image2.jpeg">image2.jpeg</a></div>

Any idea please? Thank you

1 Answer 1

0

Try something like this:

file_dir  = $file_create_url("public://");

print '<a href=' . $file_dir . '/'. $fields['value_1']->content . '</a>';
1
  • Thanks Sir. I edited my question to add the html returns by using $fields['value_1']->content
    – A.Sana
    Mar 12, 2018 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.