Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Restricting assets SS indexes


Reply


6 Posts   451 Views

Avatar
WandL

Community Member, 5 Posts

13 February 2014 at 2:04pm

Hi All,

I was wondering if there is a way to stop some folders/files being indexed by SilverStripe (3.1) when they are stored in the assets folder, we have files that are uploaded and extracted, the extracted folder I do not want this indexed automatically,

Any ideas appreciated.

Avatar
simon_w

Forum Moderator, 474 Posts

13 February 2014 at 2:30pm

The easiest way is to start the name of the folder with an underscore.

Avatar
WandL

Community Member, 5 Posts

13 February 2014 at 2:33pm

Okay thanks Simon didn't know that, is that in the documentation?

And the hard way? :)

Avatar
WandL

Community Member, 5 Posts

13 February 2014 at 3:22pm

Hi I just tried that and it doesn't work creating a folder with an leading underscore like '_foldername' still gets indexed by Silverstripe in Files.

Any other ideas?

Avatar
Devlin

Community Member, 217 Posts

14 February 2014 at 12:58am

Edited: 14/02/2014 1:01am

Yes. The leading underscore doesn't work anymore... in favour of a hardcoded '_resampled' or '_combinedfiles'... though not sure why...

You can use the dot as the prefix (.myfolder) or you can define your own blacklist pattern:

e.g.

# blacklist the underscore
Filesystem:
sync_blacklisted_patterns:
- '/^\_/'

Avatar
WandL

Community Member, 5 Posts

14 February 2014 at 11:11am

Hi Devlin, thank you that worked at treat!