• Resolved Bike

    (@bike)


    Hi David,

    Thanks for the great work. However, even though I read all info, I do not seem to be able to construct working shortcodes, every time I get some kind of ERROR: Invalid mla_gallery tax_query result.

    The only thing that works is the basic: Gallery display
    [ mla_gallery attachment_category=mycategory ], but adding any kind of parameter seems to break it, I think I tried dozens of variations and though the documentation is huge and extensive, it is not very clear (to me).

    Would you mind giving a bit more practical examples of shortcodes?
    The above outputs gives me thumbnails that are upscaled (and therefore unsharp) and link to mostly non-existent pages.

    What I want to do is quite basic, for example:

    – Have a gallery with 5 images, from a certain category, with size= thumbnail (no not upscaled), link to item (not attachment page), shown in lightbox.
    – Same, but with a certain tag.
    – Same but with a certain tag within a certain category.

    And if possible:
    – Have random images from within those sets, to avoid that if I put the same shortcode 3 times, I get the same output 3 times.

    Would you mind giving me shortcodes that I can enter on the page editor that would work for the scenarios above? Then I can (hopefully) figure out to add other aspects.

    Many thanks!

    https://www.ads-software.com/plugins/media-library-assistant/

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

    (@dglingren)

    Thanks for the good words and for your question. I know it can be frustrating to get the details right when composing a shortcode.

    Generally, the “invalid tax_query” message appears when some bit of punctuation is missing from the shortcode, or when the Visual Editor tries to “improve” the text you’re entering. It’s best to use the “Text” tab, not the “Visual” tab when entering your [mla_gallery] parameters. Also, put the entire shortcode on one line; don’t break it across multiple lines.

    You cannot have a space between the opening bracket and mla_gallery; [ mla_gallery will not work. Each shortcode parameter must be entered without any embedded spaces, i.e., orderby=date will work, but orderby = date will not. If you need spaces within a parameter value, surround the value with single or double quotes, e.g., attachment_category="some category". If you need single or double quotes within the value, use the other type of quotes to surround the value, e.g., attachment_tag="can't fail".

    With regard to “thumbnails that are upscaled (and therefore unsharp)“, the thumbnails are generated by WordPress and are not altered by MLA. However, the browser also scales some images to fit the gallery columns to with width of the browser window. You can try adding size=large or size=full to your shortcode and see how the results look.

    I don’t know why you get a “link to mostly non-existent pages“. WordPress should be able to return a “media page” for any item in the library, although your theme may produce a different result. If you want the link to go straight to the image itself you can add link=file to your shortcode. Here is a more complete example that should give you a gallery of five random images that links to the image files:

    [mla_gallery attachment_category="mycategory" posts_per_page=5 orderby=rand link=file size=thumbnail]

    Note that size=thumbnail is the default and you could leave it out. Lightbox display is not a built-in MLA feature. There are lots of lightbox plugins available and MLA will work with most of them, but the specifics are different depending which lightbox plugin you are using. Do you have a specific one in mind?

    I hope that gets you started on adding parameters to your [mla_gallery] shortcodes. I can give you more specific help with the taxonomy examples when I return from my travels next week and have access to a system I can test with. I am leaving this topic unresolved for now, and I will update it when I have more to give you. Please update the topic and let me know if the above suggestions are working for you. Thanks for your patience.

    Thread Starter Bike

    (@bike)

    Thank you very much for your helpful and extensive reply, David, especially knowing you are travelling.

    It seems that indeed the editor made some unwanted changes, the example you gave me works well.

    The images now open up automatically in my theme’s lightbox, so that is good. I mentioned the non-existent pages, as they are probably a result of using BuddyPress and the RTMedia plugin (formerly known as BP-albums), and all the re-writes these plugins use don’t work with the regular WP attachment pages.

    The only thing I need to figure out is to have the thumbnail sizes display at the actual thumbnail size.
    At the moment the above code gives me the thumbnail images that are 150px × 150px but scaled to 271px × 271px. That is why they are unsharp. So even though I specify thumbnail size, they are upscaled somehow?

    Size=full does look better as the images are fullsize but downscaled (999px × 556px (scaled to 267px × 149px)), but that means that all fullsize images will be loaded, which defeats the purpose of having thumbnails (and portrait photos will look ugly when mixed with landscape-oriented photos).

    Is there a way to ‘force’ the gallery to use/display the thumbnail size?

    Many thanks in advance for your time,
    Best regards.

    Thread Starter Bike

    (@bike)

    I just tried some different variations and it seems that adding mla_style=”none” will do the trick! I tried mla_style=”theme” as well, as I assumed that this would use the theme settings, but it changed nothing.

    Using mla_style=”none” though will display the thumbnails at their real size, so that is solved as well.

    Thanks again and best regards.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update and the good news. I’m glad the mla_style=none parameter gave you the results you need.

    As you discovered, mla_style=theme isn’t quite what you needed. That value directs MLA to use one of the WordPress filters to give the theme an opportunity to override the MLA styles, but if you theme isn’t coded to use the filter MLA will go ahead any apply its own styles. The mla_style=none parameter gets MLA out of the way entirely and uses whatever styles are coded in your theme.

    I am marking this topic resolved, but lease update it if you have any more problems or questions regarding this topic. Thanks for your interest in MLA.

    Hi David,

    Do you have a list of all the latest shortcodes in a table or something that would be great for a quick reference.

    Thanks
    Jody

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the question. There are only two shortcodes in the Media Library Assistant:

    • [mla_gallery]
    • [mla_tag_cloud]

    You can find information on both of them and all the parameters they accept in the Settings/Media Library Assistant Documentation tab.

    I have been going around in circles for days now about MLA – which sounded like the answer to my problem. The idea was to use a att tag and att cat. to dynamically search my media library and show gallery results on a page. I’ve been using [mla_gallery attachment_tag=”mytag”]
    I thought I could just enter it into the text field and it would work in the visual field – like in an html application. Is it possible to create a dynamic search of images (I have tagged and categorized all my wp library images) and I’m just doing something wrong? Or have I misunderstood the whole concept. Also – can someone produce a video about using this pluggin? I’m trying to do submenus for https://www.dickchodkowski.com/blog but I only get a return for greeting cards, father’s day and I can’t figure out how I did it, but think it’s not dynamic. Thanks in advance for any help.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for posting your question. I regret that I don’t have the time or talent to do more tutorial-style documentation and videos.

    There are lots of ways to make the link from a tag or category to an[mla_gallery] display depending on your needs. If you want to use a “tag cloud” you might want to start with this recent support topic:

    Simple Shortcodes

    Here’s an older topic that covers a “dropdown list” approach:

    Filterable Portfolio with Media Library Assistant

    This support topic uses a text-box to find items by searching their title and description:

    How to display PDF files

    Have a look at those topics and think about which approach would work for your site. I am happy to work with you on adapting any of the approaches to your needs, but it would be great if you started a new support topic with more information so I can focus on your needs. Thanks for you interest in the plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Basic shortcodes doumentation’ is closed to new replies.