Is there any way to make the Assets folder also show the first sub folder level by default, like in the attached screenshot?

enter image description here

  • I would like to see this as well!
    – Anna_MediaGirl
    Oct 16 '17 at 18:43

You could modify this JavaScript to do it for you. We currently have it running on a site where this was sought-after

Caveat: Our script opens ALL folders, not just the first level - hence the need to modify.

jQuery(window).on('load', function() {
    var $ = jQuery;

    var openFolders = function() {
        var imageRootLinks = $('a[data-key^="folder:"]');

        $.each(imageRootLinks, function(index, link) {
            var imageRoot = $(link).parent();
            var toggle = imageRoot.find('.toggle');
            if (toggle.length && !imageRoot.hasClass('expanded')) {

    // open folders in left menu

    // open folders in image selector
    $(document).ajaxComplete(function(e, status, requestData) {
        if (requestData.url && requestData.url.indexOf('getElements') && requestData.data && requestData.data.indexOf('context=modal&elementType=Asset') != -1) {

Then simply include the JS-file through a plugin

// runs on all requests
public function init() {
    // check that user is logged in and in the control panel
    if ( craft()->request->isCpRequest() && craft()->userSession->isLoggedIn() ) {
        // the includeJsResource method will add a js file to the bottom of the page


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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