• Resolved upandrunningdesign

    (@upandrunningdesign)


    I’m trying to display a category of pdf’s in a ul. I would like the following:

    • Link as title (No image/icon)
    • Link to open in a new tab/window.B
    • Target a category

    Below is the code I was trying to use, not sure if I’m on the right track. Thanks in advance!

    [mla_gallery]
    post_mime_type="application/pdf"
    link=file
    mla_target="_blank"
    mla_caption="{+title+}"
    tax_query="array(array('taxonomy'=>'attachment_category','field'=>'slug','terms'=>'all-program'),array('taxonomy'=>'attachment_tag','field'=>'slug','terms'=>'all=program'),'relation'=>'OR')"
    [/mla_gallery]
Viewing 1 replies (of 1 total)
  • Plugin Author David Lingren

    (@dglingren)

    Good to hear from you again. Thanks for your question and for posting the complete text of your shortcode; very helpful.

    First, I did notice a small error on your shortcode. the attachment_tag 'terms'=>'all=program' parameter should be 'terms'=>'all-program'.

    You can get closer to your goal with some additional parameters:

    
    [mla_gallery]
    post_mime_type="application/pdf"
    link=file
    mla_target="_blank"
    mla_caption=" "
    size=none
    columns=1
    mla_float=left
    mla_itemwidth=none
    tax_query="array(array('taxonomy'=>'attachment_category','field'=>'slug','terms'=>'all-program'),array('taxonomy'=>'attachment_tag','field'=>'slug','terms'=>'all-program'),'relation'=>'OR')"
    [/mla_gallery]
    

    You can also use the “simple taxonomy parameters” instead of the more complex tax_query (which also works fine):

    
    [mla_gallery]
    post_mime_type="application/pdf"
    link=file
    mla_target="_blank"
    mla_caption=" "
    size=none
    columns=1
    mla_float=left
    mla_itemwidth=none
    attachment_category=all-program
    attachment_tag=all-program
    tax_relation=OR
    [/mla_gallery]
    

    However, you should try a custom markup template to get the results you really want. Here is a template that will give you a good start:

    Name
    simple-list

    Description
    Simple ul/ol list, e.g., for PDF documents

    Arguments

    listtag=ul
    itemtag=li
    link=file
    size=none
    columns=0
    mla_target="_blank"
    

    Open
    <[+query:listtag+]>

    Row Open
    (leave blank)

    Item

    <[+itemtag+] class='gallery-item'>
    	[+link+]
    </[+itemtag+]>
    

    Row Close
    (leave blank)

    Close
    </[+query:listtag+]>

    To add this template to your MLA configuration:

    1. Navigate to the Settings/Media Library Assistant Shortcodes tab.
    2. Click the “Add New Template” button above the list of view links.
    3. Select “Markup” and “Gallery” in the dropdown controls at the top of the “Add Template” screen.
    4. Enter the values shown above in the appropriate text boxes on the screen.
    5. Scroll to the bottom of the screen and click “Add Template” to save your work.

    Once that’s done you can change your shortcode to use the new template:

    
    [mla_gallery]
    post_mime_type="application/pdf"
    mla_markup=simple-list
    attachment_category=all-program
    attachment_tag=all-program
    tax_relation=OR
    [/mla_gallery]
    

    Note that I have moved some of the parameters to the Arguments section to shorten your shortcode. You could add listtag=ol to your shortcode to change the list type from unordered to ordered. You can find more information on custom templates in the “Style and Markup Templates” section of the Settings/Media Library Assistant Documentation tab.

    If you want to see some other approaches, here are some earlier topics along similar lines:

    Basic pdf list with pdf icons

    gallery of pdf’s

    Simple List

    I hope that gets you started with an improved solution for your application. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions.

Viewing 1 replies (of 1 total)
  • The topic ‘pdf’s display in ul’ is closed to new replies.