Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
4 posts Page 1 of 1
Shows size hint for your editable type 'file'.

2018-08-05-002.png
2018-08-05-002.png (7.27 KiB) Viewed 3247 times

2018-08-05-003.png
2018-08-05-003.png (8.12 KiB) Viewed 3247 times


My definition:
Code: Select all
<cms:editable type='file'  name='gg_media' label='File' desc='Upload the file here' order='50' />

Configuration:
Code: Select all
<cms:config_form_view>
   
   <cms:field 'gg_media__size' no_wrapper='1' order='51'>
      <cms:call 'file_size' file=gg_media />
   </cms:field>
   
</cms:config_form_view>

It's handy to output such info to list-view in backend for a quick action.
See viewtopic.php?f=8&t=11665

2018-08-05-007.png
2018-08-05-007.png (27.84 KiB) Viewed 3238 times

Thank you for this another great and useful addition for the best CMS ever.

As a more generic solution, please try a function - https://github.com/trendoman/utility-fu ... _size.html
4 posts Page 1 of 1