Coral Ui - Restricting the root path for assetpicker | Community
Skip to main content
Level 2
Dec 12, 2017 9:03 AM UTC
Solved

Coral Ui - Restricting the root path for assetpicker

How can we restrict the root path for the assetpicker (coral ui) to pick assets from a designated root path (some folder under dam) only.

Please also suggest me good sources to read concepts on coral ui.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
georget70968317Accepted solution
New Participant
Jan 18, 2018 5:32 PM UTC

I managed to get it working with the following code.

             Granite.author.ui.assetFinder.registry.Images.searchRoot = data.restrict;

            Granite.author.ui.assetFinder.registry.Images.setSearchPath(data.restrict);

            $('foundation-autocomplete.coral-Form-field.assetfilter.path').val(data.restrict);

            Granite.author.ui.assetFinder.utilsCommons.loadAssets(false);

5 replies

smacdonald2008
Level 10
Jan 18, 2018 8:04 PM UTC

Thxs for posting this!

Translate
georget70968317Accepted solution
New Participant
Jan 18, 2018 5:32 PM UTC

I managed to get it working with the following code.

             Granite.author.ui.assetFinder.registry.Images.searchRoot = data.restrict;

            Granite.author.ui.assetFinder.registry.Images.setSearchPath(data.restrict);

            $('foundation-autocomplete.coral-Form-field.assetfilter.path').val(data.restrict);

            Granite.author.ui.assetFinder.utilsCommons.loadAssets(false);

Translate
New Participant
Jan 18, 2018 5:10 PM UTC

Is there any answer to this ?

In 6.2 I had a clientlib that did

            Granite.author.ui.assetFinder.registry.Images.searchRoot = data.restrict;

            Granite.author.ui.assetFinder.registry.Images.setSearchPath(data.restrict);

            $('.coral-InputGroup-input.coral-Textfield.js-coral-pathbrowser-input[name=assetfilter_image_path]').val(data.restrict);

            Granite.author.ui.assetFinder.utilsCommons.loadAssets(false);

where data.restrict is the path i want to set the filter to

This doesn't work in 6.3, even though i can see the page code is calling the loadAssets(false) it isn't updating the images

Translate
Level 2
Dec 12, 2017 2:47 PM UTC

I am using AEM 6.3, yes correct it is the same component that i have implemented using coral ui in render.jsp.

Translate
rmahendra
Employee
Dec 12, 2017 10:58 AM UTC

Which AEM version are you using? Also are you taking about http://localhost:4502/aem/assetpicker.html  ?

Translate