Hi i am having issue in twig template. What i am trying is to upload image to s3 bucket using custom module and jquery file uploader for that i have createa a custom field type but m stuck in a place where i am trying to render twig from form element page. Twig is rendering but part of it is not working dont know why here is my field widget class
public function formElement(
FieldItemListInterface $items,
$delta,
Array $element,
Array &$form,
FormStateInterface $formState
) {
$s3FormDetailss = GetSignature::getSignature();// To get the policy
$element['s3_select_image'] = array(
'#theme' => 'image_uploade_page',
'#s3FormDetails' => $s3FormDetailss,
$element['#attached']['drupalSettings']['variable'] = $s3FormDetailss,
$element['#attached']['library'][]= 's3_file_uploader/s3_file_uploader-styles',
);
return $element;
}
Here is twig class
{{ attach_library('s3_file_uploader/s3_file_uploader-styles') }}
<div class="container">
<!-- <h1>Direct Upload to data</h1> -->
<!-- This part is not working and everything else is working -->
<form action= "{{ s3FormDetails.url }}"
method="POST"
enctype="multipart/form-data"
class="direct-upload">
{% for key,value in s3FormDetails.inputs %}
<input type="hidden" name="{{ key }}" value="{{ value }}">
{% endfor %}
<!-- Key is the file's name on S3 and will be filled in with JS -->
<input type="hidden" name="key" value="">
<input type="file" name="file" multiple>
<!-- Progress Bars to show upload completion percentage -->
<div class="progress-bar-area"></div>
</form>
<!-- This area will be filled with our results (mainly for debugging) -->
<div>
<!-- <h3>Files</h3> -->
<textarea id="uploaded" name="hide" style="display:none;"></textarea>
</div>
</div>
in twig class everything is working as it should be but everything inside form tag is not working dont know why please help