Coral Ui - Restricting the root path for assetpicker | Community
Skip to main content
Level 2
December 12, 2017
Solved

Coral Ui - Restricting the root path for assetpicker

  • December 12, 2017
  • 5 replies
  • 3074 views

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.
Best answer by georget70968317

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

rmahendra
Adobe Employee
Adobe Employee
December 12, 2017

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

Level 2
December 12, 2017

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

January 18, 2018

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

georget70968317Accepted solution
January 18, 2018

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);

smacdonald2008
Level 10
January 18, 2018

Thxs for posting this!