• Resolved 3lstudios

    (@3lstudios)


    I am trying to create a resource page on my company’s site that lists all pdfs for catalogs, spec sheets, etc. I am using the Astra Pro theme with Elementor. I have created tabs on the page for each category (Catalogs, Spec Sheets, etc) for sorting using attachment categories.

    1) When I view the list, the icon is stacked on top of the caption instead of in front of it. I have tried to add display:inline; and float:left; in the style, but it isn’t working. It seems that they are possibly in different cells? How can I place them in the same cell or float them next to each other within the same gallery-item?

    This is the code used on the page:
    [mla_gallery]

    post_parent=all
    post_mime_type=application/pdf
    attachment_category=spec-sheets
    columns=4
    orderby=name
    order=asc
    size=icon
    mla_caption=”{+title+}”
    link=file
    display=inline
    mla_target=”_blank”

    [/mla_gallery]

    This is the code in the style:
    style type=’text/css
    #[+selector+] {
    margin: auto;
    width: 100%;
    }
    #[+selector+] .gallery-item {
    float: [+float+];
    margin: [+margin+];
    text-align: center;
    width: [+itemwidth+];
    }

    #[+selector+] .gallery-icon {
    width: 30px;
    }
    #[+selector+] .gallery-icon img {
    width: 20px;
    }
    #[+selector+] .gallery-caption {
    float: left;
    margin-left: 0;
    vertical-align: top;
    }

    /style

    2) How can I sort further, by sub-categories? For example, In my category spec sheets, there will be hundreds of files and I want to organize by types (lamps, downlights, linear fixtures, etc.). Is there another search criteria like the “attachment_category” that can be added so it will only show anything that is both attachment_category=spec-sheets and {other category/tag name}=lamps?

    3) Can the caption title also work as a link and not just the icon image? I would like both to be a clickable option.

    Thank you for your help!

    • This topic was modified 4 years, 7 months ago by 3lstudios.
Viewing 1 replies (of 1 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your questions and for including the text of your shortcode and style template; very helpful.

    Regarding your first question, I regret that my CSS skills are limited and I cannot offer you much help. the [mla_gallery] shortcode is intended to be as “WordPress-like” as possible, which in this case means that the styles and HTML markup are intended to emulate the WordPress [gallery] shortcode as closely as possible. Many themes include styles and other features that use the classes provided by [gallery] to format the gallery display. You might also consider one of the many other gallery and/or lightbox plugins that offer more elaborate layouts. MLA’s “Support for Other Gallery-generating Shortcodes” lets you combine these with MLA’s data selection features.

    Regarding your second question, “How can I sort further, by sub-categories?“, you can use the additional parameters described in the “Simple Taxonomy Parameters” section of the Settings/Media Library Assistant Documentation tab. For your example, you could code something like:

    [mla_gallery attachment_category='spec-sheets,lamps' tax_operator=AND tax_include_children=false]
    

    You may or may not need the tax_include_children=false parameter, depending on your taxonomy structure. You can also explore the more powerful tax_query capability that supports additional multi-term and multi-taxonomy options.

    Regarding your third question, you can change the caption value to be a link in a couple of different ways. For complete control you can define a custom markup template and replace the caption HTML with anything you need, such as an active link. For simple applications you can use the mla_caption parameter to compose the link. Here is an earlier topic that illustrates this alternative:

    Link in file instead of icon

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

Viewing 1 replies (of 1 total)
  • The topic ‘Styling and sorting questions’ is closed to new replies.