I have create A Image upload field Using UI Component. Now I want to Hide or Delete Button. Any help would be appreciated.

enter image description here

  • Have you found any solution for this? – Chirag Patel Aug 28 '19 at 12:57
  • yes i removed that with the help of CSS. – sudo55 Sep 4 '19 at 12:59
  • Thanks is there any other way to remove without using CSS. – Chirag Patel Sep 5 '19 at 4:30
  • let me know when you find out. – sudo55 Sep 5 '19 at 5:09

For your module you should Create [Namespace][Module]\view\base\web\templates\form\element\uploader\image.html


<div class="admin__field-control" css="'_with-tooltip': $data.tooltip">
    <div class="file-uploader image-uploader" data-role="drop-zone" css="_loading: isLoading">
        <div class="file-uploader-area">
            <input type="file" afterRender="onElementRender" attr="id: uid, name: inputName, multiple: isMultipleFiles" disable="disabled" />
            <label class="file-uploader-button action-default" attr="for: uid, disabled: disabled" disable="disabled" translate="'Upload'" />                
            <render args="fallbackResetTpl" if="$data.showFallbackReset && $data.isDifferedFromDefault"/>
            <p class="image-upload-requirements">
                <span if="$data.maxFileSize">
                    <span translate="'Maximum file size'" />: <text args="formatSize($data.maxFileSize)"/>.
                <span if="$data.allowedExtensions">
                    <span translate="'Allowed file types'" />: <text args="getAllowedFileExtensionsInCommaDelimitedFormat()"/>.

        <render args="tooltipTpl" if="$data.tooltip"/>

        <div class="admin__field-note" if="$data.notice" attr="id: noticeId">
            <span html="notice"/>

        <label class="admin__field-error" if="error" attr="for: uid" text="error"/>

        <each args="data: value, as: '$file'" render="$parent.getPreviewTmpl($file)"/>

        <div if="!hasData()" class="image image-placeholder" click="triggerImageUpload">
            <div class="file-uploader-summary product-image-wrapper">
                <div class="file-uploader-spinner image-uploader-spinner" />
                <p class="image-placeholder-text" translate="'Browse to find or drag image here'"/>
    <render args="$data.service.template" if="$data.hasService()"/>


also in [Namespace]/[Module]/view/frontend/requirejs-config.js add this:

var config = {
    map: {
        '*': {
| improve this answer | |

use below ui component

in your ui file use below code

<field name="image">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">string</item>
            <item name="source" xsi:type="string">store</item>
            <item name="label" xsi:type="string" translate="true">Image</item>
            <item name="visible" xsi:type="boolean">true</item>
            <item name="formElement" xsi:type="string">fileUploader</item>
            <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
            <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
            <item name="required" xsi:type="boolean">false</item>
            <item name="uploaderConfig" xsi:type="array">
                <item name="url" xsi:type="url" path="*/*/upload"/>

for the previewTmpl you can refer to the Magento_Catalog/image-preview template and add into your module and modify as per your preferance

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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