Jump to content

[solved] Hide/expand individual FieldtypeFiles file entries meta in admin


Recommended Posts

Posted

AFAIK, a PageFiles field shows all files, including file descriptions, tags, etc. The visibility option is for the entire field.

It would be helpful to minimise the file list in admin to filename or custom fields, eg {basename} {modified}, only in the admin area similar to repeaters. A down arrow could expand individual file meta.

When a page has lots of attached files, it's cumbersome to scroll through all the files with descriptions & tags when the field visibility is "Open".

  • Like 3
Posted

Sounds good. In the meantime it's easy to do with a little custom CSS and JS.

.InputfieldFileData { display:none; }
.data-open + .InputfieldFileData { display:block; }

 

$(document).on('click', '.InputfieldFileInfo', function() {
    $(this).toggleClass('data-open');
});

image.gif.c7f7c7223cb9f495c27b842ec8b611a5.gif

  • Like 4
  • Thanks 2
Posted

And the final piece of the puzzle, again thanks to  @Robin S, in site/templates/admin.php, see this post:

 

$wire->addHookAfter('AdminTheme::getExtraMarkup', function(HookEvent $event) {
    $scripts = wire('files')->render('inc/admin-tpl-hook');
    $parts = $event->return;
    $parts['head'] .= $scripts;
    $event->return = $parts;
});

 

  • psy changed the title to [solved] Hide/expand individual FieldtypeFiles file entries meta in admin

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...