0

I'd like to make Assets ignore html files that appear in my file upload directories. I've looked through the Assets docs, and can see that there's a config override that seems to allow this named assets_ignore_file_patterns.

However, I can't find a working example of how to use this that I can copy from, so can anyone give me a complete working example that I could use in my EE config file that would allow Assets to ignore files that have a .html extension please? I'm using ExpressionEngine 2.7.2 and Assets 2.2.2, and thanks in advance for any help.

Also, as an aside, the reason my upload directory has an index.html file within it is because I'm using this method for my .gitignore file.

2 Answers 2

1

Sure, try this in your config file:

$config['assets_ignore_file_patterns'] = array('/\.html$/');
1
  • Thanks for this, Derek, that seems to do the trick nicely. :)
    – Stephen
    Jan 29, 2014 at 14:25
1

There was a change in Assets 2.2.3, "config settings no longer require slashes in the array values". If you want Asset to ignore PHP, HTML and JavaScript files, you can try this:

$config['assets_ignore_file_patterns'] = array('^.*\.(php|html|htm|js)$');

Important step: after changing the config, you have to update the indexes.

1
  • Hi Lutz, thanks for posting that extra info.
    – Stephen
    Jun 8, 2015 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.