Freitag, 8. Februar 2013

Howto disable upload of CQ5 SmartImage

According to the SmartImage API docs, there is a option to disable the upload of this component.
allowUpload="false"
Unfortunately, it is still possible. I tried to solve it, by preventing the click event. Nothing. I solved it using a CSS workaround, that hides the file upload field. Don't forget to specify the id in both snippets.
<image jcr:primaryType="cq:Widget" allowUpload="false" ddGroups="[media]" height="300" mimeTypes="*.jpg;*.jpeg;*.gif;*.png" mimeTypesDescription="Images" name="./image" hideLabel="true" id="some-unique-id" xtype="smartimage"> // ... </image>
Add this to your css to hide the upload field
/* Hide upload field */ #some-unique-id .x-form-item { display: none!important; }

Keine Kommentare:

Kommentar veröffentlichen