So following the documentation here I should be able to disable the allowUpload feature to force authors to use just the Assets:
https://docs.adobe.com/docs/en/aem/6-1/develop/components/components-develop.html#Disable%20Upload%2...
I am attempting to do this with TouchUI and not with classic.
I have attempted
Boolean
allowUpload="{Boolean}false"
String
allowUpload="false"
Solved! Go to Solution.
How to turn off the allowUpload in the Image component.
So in TouchUI dialogs you will need to create your new image component.
The sling:resourceSuperType will now inherit all the properties, functionality and dialog of the wcm/foundation/components/image
Now we want to create an TouchUI cq:dialog overlay.
Because our component is inheriting from the foundation image component we are also inheriting the dialogs. So much like the jsps back in 5.6 we only have to overwrite the parts we need to.
Now we are going to disable the file upload option
This disables the upload button and the authors can drag and drop an item from the sidebar, but I would like to have my UI a little more intuitive, by making the area they can drop target visible.
In CRXDE Lite navigate to
/libs/granite/ui/components/foundation/form/fileupload
Copy the fileupload folder
Navigate back to your image component and paste the item.
Open the fileupload.jsp in CRXDE
At line 240 right under fieldAttrs.addClass("coral-Form-field");
Add this
// show drop target when disabled if(cfg.get("disabled", false)){ fieldAttrs.addClass("is-active"); }
What this will do is automatically add the "is-active" css class to the drop target input for the file upload. This in turn displays the target that you see when dragging an image from the Asset Finder.
Then at line 253 under buttonAttrs.addClass("coral-FileUpload-trigger coral-Button");
Add this
// hide button when button is disabled if(cfg.get("disabled", false)){ buttonAttrs.add("style","display:none;"); }
This will hide the disabled Upload Image button so there is no confusion why the button is disabled.
Now we have to update your dialog to use our new form for the fileupload.
Now you can drop your image component on the page and see your new dialog.
Views
Replies
Total Likes
the document is about turning off when for the classic dialog and not for Touch UI.
Views
Replies
Total Likes
I dont see any option to turn it off on Touch UI dialog. Please raise a support ticket for the same.
Views
Replies
Total Likes
I put in a ticket and I will add the response for the greater good.
So on your file node you want to add a disabled property and set the value to true
/libs/foundation/components/image/cq:dialog/content/items/column/items/file
disabled="{Boolean}true"
This will only disable the button. Currently there is no visible spot for the author to drop an image from the Assets, but they still can.
Views
Replies
Total Likes
Hi cjantoli
Yes, its a miss in documentation. Its only for classic UI.
//
public abstract boolean allowUpload
We will let documentation know about this.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
How to turn off the allowUpload in the Image component.
So in TouchUI dialogs you will need to create your new image component.
The sling:resourceSuperType will now inherit all the properties, functionality and dialog of the wcm/foundation/components/image
Now we want to create an TouchUI cq:dialog overlay.
Because our component is inheriting from the foundation image component we are also inheriting the dialogs. So much like the jsps back in 5.6 we only have to overwrite the parts we need to.
Now we are going to disable the file upload option
This disables the upload button and the authors can drag and drop an item from the sidebar, but I would like to have my UI a little more intuitive, by making the area they can drop target visible.
In CRXDE Lite navigate to
/libs/granite/ui/components/foundation/form/fileupload
Copy the fileupload folder
Navigate back to your image component and paste the item.
Open the fileupload.jsp in CRXDE
At line 240 right under fieldAttrs.addClass("coral-Form-field");
Add this
// show drop target when disabled if(cfg.get("disabled", false)){ fieldAttrs.addClass("is-active"); }
What this will do is automatically add the "is-active" css class to the drop target input for the file upload. This in turn displays the target that you see when dragging an image from the Asset Finder.
Then at line 253 under buttonAttrs.addClass("coral-FileUpload-trigger coral-Button");
Add this
// hide button when button is disabled if(cfg.get("disabled", false)){ buttonAttrs.add("style","display:none;"); }
This will hide the disabled Upload Image button so there is no confusion why the button is disabled.
Now we have to update your dialog to use our new form for the fileupload.
Now you can drop your image component on the page and see your new dialog.
Views
Replies
Total Likes
How to turn off the allowUpload in the Image component.
So in TouchUI dialogs you will need to create your new image component.
The sling:resourceSuperType will now inherit all the properties, functionality and dialog of the wcm/foundation/components/image
Now we want to create an TouchUI cq:dialog overlay.
Because our component is inheriting from the foundation image component we are also inheriting the dialogs. So much like the jsps back in 5.6 we only have to overwrite the parts we need to.
Now we are going to disable the file upload option
This disables the upload button and the authors can drag and drop an item from the sidebar, but I would like to have my UI a little more intuitive, by making the area they can drop target visible.
In CRXDE Lite navigate to
/libs/granite/ui/components/foundation/form/fileupload
Copy the fileupload folder
Navigate back to your image component and paste the item.
Open the fileupload.jsp in CRXDE
At line 240 right under fieldAttrs.addClass("coral-Form-field");
Add this
// show drop target when disabled if(cfg.get("disabled", false)){ fieldAttrs.addClass("is-active"); }
What this will do is automatically add the "is-active" css class to the drop target input for the file upload. This in turn displays the target that you see when dragging an image from the Asset Finder.
Then at line 253 under buttonAttrs.addClass("coral-FileUpload-trigger coral-Button");
Add this
// hide button when button is disabled if(cfg.get("disabled", false)){ buttonAttrs.add("style","display:none;"); }
This will hide the disabled Upload Image button so there is no confusion why the button is disabled.
Now we have to update your dialog to use our new form for the fileupload.
Now you can drop your image component on the page and see your new dialog.
Views
Replies
Total Likes
This is really helpful !! Thanks for sharing....
This is really helpful !! Thanks for sharing....
Update:
in AEM 6.2 allowUpload="false" works in the same way as it works in Classic UI.
Just add this property to the node "file" of sling:resourceType = 'granite/ui/components/
before:
after:
Hi,
is there anyway to remove Generate Preview button as well?
Views
Replies
Total Likes
Yes,
Use sling resource merger concept
https://helpx.adobe.com/experience-manager/6-2/sites/developing/using/sling-resource-merger.html
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies