Support » Plugin: Media Library Assistant » Gallery markup

  • Resolved pulger

    (@pulger)


    Hi,

    Apologies for the noob questions, I’m finding the amazing documentation a little intimidating and dont know were to start!

    I’d like to present a simple list of PDFs, by category using the gallery shortcode – which I’ve managed to do and it works great!

    But I’d like to render the list as an unordered list rather than the <dl> it seems to do by default. This is the bit I’m having bother with! 🙂

    My current code: [mla_gallery post_parent=all post_mime_type=application/pdf attachment_category=’general_docs’]

    It would be nice to attach file info too, like file size for the convenience of my visitors, as some of the pdfs are quite large.

    Many thanks, amazing plugin!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter pulger

    (@pulger)

    Ok, hit the panic button too quickly! Mangaed to figure it out – this is working for me in a new template:

    <a title="Download [+title+] - [+file_size,kbmb(1024,Kb,Mb,1)+]" href="[+filelink_url+]">[+title+]</a> <span class="file-info">[+file_size,kbmb(1024,Kb,Mb,1)+] <strong>([+upload_date,date('Y')+])</strong></span>
    
    <p>[+description+]</p>

    The only thing I’d like a bit of control over is the file size kbmb, is there a way to output it as MB only? So 900kb would display as 0.9MB?
    thanks!

    • This reply was modified 1 month, 3 weeks ago by pulger.
    • This reply was modified 1 month, 3 weeks ago by pulger.
    Plugin Author David Lingren

    (@dglingren)

    Thanks for your question and for taking the time to find your own answer before I could respond.

    You wrote “The only thing I’d like a bit of control over is the file size kbmb, is there a way to output it as MB only? So 900kb would display as 0.9MB?” Let me look into that and see if the kbmb() function can be enhanced to do that. I will post an update here when I have progress to report.

    Thanks for your patience and your interest in the plugin.

    Thread Starter pulger

    (@pulger)

    Thank you David for the support, I love this plugin!

    Plugin Author David Lingren

    (@dglingren)

    I have uploaded a new MLA Development Version dated 20210406 that adds a megabyte-only option to the ,kbmb() field-level option/format value. You can find step-by-step instructions for using the Development Version in this support topic:

    PHP Warning on media upload with Polylang

    Here’s the explanation from the “Field-level option/format values” section of the Settings/Media Library Assistant Documentation tab:

    If the “k” argument is empty and the “m” argument is present all numbers above the threshold will be displayed in megabytes. For example, the value “,kbmb(10240,,Mb)” or “,kbmb(10240,”,Mb)” would display 15360 bytes “0.015Mb”.

    It would be great if you could install the Development Version and let me know if it works for you. Thanks again for inspiring this MLA enhancement.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.