1

I would like to modify how assets are displayed within asset fields in the control panel's edit entry page, so that thumbnails are larger and the name is not displayed.

After some investigation I found that when assets are added to an entry the following line is called {% hook "cp.elements.element" %}. This is calling the template service generating the html that displays the thumbnails and the name. ( _getCpElementHtml() is the function that is associated with the hook ) Is there a way to modify this without directly changing the core files?

1 Answer 1

1

Short answer: no. The thumbnail size (30x30) is hardcoded into the method you found (_getCpElementHtml), so there's no way you can change that.

You could try extending the control panel's CSS (using this plugin) to enlarge and/or hide certain elements, but that won't get the thumb any bigger.

1
  • Thanks, would it be somehow possible if i duplicated the assets field type and element type in a plugin? i tried that and im kind of stuck on the elements template that use the hooks tag, can i maybe instead of the {% hook do everything in the template ? i know that the hook function has a massive context object and i think thats the reason it has not been done in the templates in the first place Feb 2, 2015 at 8:43

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.