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   382 Views

Avatar
WandL

13 February 2014 at 2:04pm Community Member, 4 Posts

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

13 February 2014 at 2:30pm Forum Moderator, 474 Posts

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

Avatar
WandL

13 February 2014 at 2:33pm Community Member, 4 Posts

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

And the hard way? :)

Avatar
WandL

13 February 2014 at 3:22pm Community Member, 4 Posts

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

14 February 2014 at 12:58am (Last edited: 14 February 2014 1:01am), Community Member, 215 Posts

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

14 February 2014 at 11:11am Community Member, 4 Posts

Hi Devlin, thank you that worked at treat!