• Resolved jeff41

    (@jeff41)


    Do following code works successfully on one website to display the title field of a PDF file on one website, but the same code displays a picture of the PDF file and not the name. How do I get the title shown instead?

    [mla_gallery post_mime_type=application/pdf post_parent=all link=file mla_viewer=true columns=1 orderby=date order=desc attachment_category=”scsw-minutes”]

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your question, which is similar to this earlier topic:

    mla list of pdfs

    Thanks as well for posting the text of your shortcode; very helpful. The mla_viewer=true parameter will try to generate a thumbnail image (picture) of the PDF file. You can replace that parameter with size=none to get the results you seek:

    [mla_gallery post_mime_type=application/pdf post_parent=all link=file size=none columns=1 orderby=date order=desc attachment_category="scsw-minutes"]
    

    I suspect that the “success” you had on one site is because that site does not have imageMagick and imagick installed, while the “failing” site includes these components.

    I am marking this topic resolved, but please update it if you have problems or further questions regarding the above suggestions. Thanks for your interest in the plugin.

    Thread Starter jeff41

    (@jeff41)

    Thank you, David. That was exactly the solution. I couldn’t think of a search that would get me an answer. In hindsight “PDF” would have got me there.

    If you look at the same page, the title is now word wrapped although there is enough room to print the full title on one line. I was thinking it might be because the algorithm thought it was still icon sized. Playing around with all the size parameters has no effect though.

    So could I again ask your help? The title was printed on one line in the old site, but is wrapped over several lines in this one. Any suggestions for fixing that.

    Thanks for your help. Ito a great plugin.
    Jeff

    Thread Starter jeff41

    (@jeff41)

    I found a workaround, David. It appears substituting an underbar for a hyphen in the title prevents the word wrap. There is a lot of space left between the list of titles, but I suspect that’s caused by the theme.

    Jeff

    Hi Jeff,

    I thought I’d share some of my experiences (as enhanced with David’s excellent support) – using the browser’s Inspect I spotted that:
    The line spacing appears to be coming from the style on your gallery item:
    #top .gallery .gallery-item {
    margin: 1px 1px 0 0;
    width: 80px;
    height: 80px;
    padding: 0;
    }
    It’s the height that increases the spacing.

    Also, the class for gallery-icon has a trailing space which may be affecting it pick up the style for that class.

    For info my MLA pages that display PDFs are here https://downtonparishcouncil.gov.uk/main-council/agendas-and-minutes

    Thread Starter jeff41

    (@jeff41)

    Thank you very much, cuckoofairweb.

    I suspected it was a style issue. Thank you for pointing out exactly where. By the way, that is an impressive page you have there.

    Jeff

    Plugin Author David Lingren

    (@dglingren)

    Thanks, @cuckoofairweb, for jumping in with some excellent analysis and suggestions. Regarding the “title is now word wrapped” issue there is a CSS style that might be an alternative to the dash/underscore approach:

    CSS white-space Property

    If you have any remaining issues, post an update and continue the thread.

    Jeff,

    The page is even more impressive as it only uses 1 style/markup and each of the annual tables only need a single change to a tag value! It does however require the properties in the PDFs to be setup correctly and the filenames to be consistently named.

    I am certain I am only scratching the surface of what MLA can do – the recent ‘Latest Meeting’ is again tag driven.

    Paul

    Thread Starter jeff41

    (@jeff41)

    Thank you, Paul.
    With the free version of elementor, I was able to add css
    #top .gallery .gallery-item { height: 10px; } to fix the problem.

    The borders you have around the pdf entries in your table make a much more professional presentation. I was not able to find an example of how to do that. Did you use the style parameter in the mla_gallery shortcode? I would be interested to know how you did that.

    Thanks for your help solving my height problem.

    Jeff

    Hi Jeff,

    I tried to use the style setup within MLA and with David’s excellent help I tidied them up a lot.

    <style type='text/css'>
    #[+selector+] {
    margin: 0;
    width: 100%;
    border: 0px solid #abbd7b;
    }
    #[+selector+] table {
    border: 0px dashed #abbd7b;
    border-collapse: separate;
    padding-top: 1px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    }
    
    /* colour is abbd7b */
    
    #[+selector+] tbody {
    border: 4px solid #fffff;
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    width: 100%;
    }
    #[+selector+] th.gallery-title {
    width: 88%;
    height: 16;
    vertical-align: top;
    }
    #[+selector+] th.gallery-icon  {
    width: 12%;
    height: 16;
    vertical-align: top;
    }
    #[+selector+] td.gallery-icon img {
    border: 0px solid #abbd7b;
    }
    #[+selector+] .gallery-row {
    float: none;
    text-align: left;
    width: auto;
    padding: 0;
    }
    #[+selector+] td {
    padding: 0.2em;
    }
    #[+selector+] .header-row {
    float: none;
    text-align: left;
    font-weight: bold;
    }
    #[+selector+] .gallery-caption {
    margin-left: 0;
    vertical-align: top;
    }
    </style>

    However, due to an impossible to resolve conflict with Tablepress plug-in styling in the end I had to add this css style to the theme CSS customisation section:

    `table td, table th, tbody {
    border: 3px solid #abbd7b;
    padding-top: 2px;
    padding-right: 7px;
    padding-bottom: 2px;
    padding-left: 7px;
    }

    which admittedly forced ALL site tables to have a 3px off-green border!!

    Paul

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Display PDF files by title’ is closed to new replies.