Coral Ui - Restricting the root path for assetpicker | Adobe Higher Education
Skip to main content
Level 2
December 12, 2017
해결됨

Coral Ui - Restricting the root path for assetpicker

  • December 12, 2017
  • 5 답변들
  • 3077 조회

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.

이 주제는 답변이 닫혔습니다.
최고의 답변: 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 답변

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

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!