• Resolved luigsm

    (@luigsm)


    I think your plugin of one of the best plugins. This is capable of doing everything I would like to do. It seems to give me SO MUCH POWER with my galleries. I have a few questions.

    I am trying to use multiple templates in different areas of my pages and throughout my site. I am doing something wrong to call different templates.

    Here is one of my uses [mla_gallery mla_caption=”” type=”default” attachment_category=”traditional” orderby=rand link=”file” numberposts=1]

    I am running into 2 problems.
    1. TYPE is giving access to 1 template as a time. If I change the type it does nothing. If I change the MLA Gallery tab to a different template, it changes everything everywhere.

    Is there a way to make each [mla_gallery to be a different template? I believe there is any I am doing something wrong.

    2. There is a caption below my image and I would like it to go away, but am having no luck. I have tried mla_caption=”” and tried using css with visibility=hidden and height=0 and that did not work.

    https://ww.wp.xz.cn/plugins/media-library-assistant/

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

    (@luigsm)

    from your other help files I have been able to how to change the css, but would love to be able to call it from your templates.

    This is how I am bypassing your template, but not what i would like to do, as your work is way better than mine.
    <div class=”center”>[mla_gallery mla_style=none mla_caption=”” type=”default” attachment_category=”traditional” orderby=rand link=”file” numberposts=1]</div>

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your kind words and for your questions regarding custom style and markup templates. Thanks as well for posting the source text of your shortcode; very helpful.

    You have found the Settimgs/Media Library Assistant MLA Gallery Tab, which will let you define your own style and markup templates. To apply your custom template(s) to a specific [mla_gallery] shortcode you must add mla_style and/or mla_markup parameters. For example, if you create a custom style template called my-styles and a custom markup template called my-markup you access them with something like:

    [mla_gallery mla_style="my-styles" mla_markup=-"my-markup" attachment_category="traditional" orderby=rand link="file" numberposts=1]

    The type parameter in your shortcode example does not affect the markup template (it is used by the Jetpack plugins to select a gallery display type).

    Once you get custom markup templates working you can easily define one to suppress the caption. If you want to use mla_caption to suppress the caption the following trick will work:

    mla_caption="{+template:({+empty+})+}"

    This trick uses a Content Template with parentheses that test for a non-empty value and display nothing if an empty value is found. The {+empty+} substitution parameter doesn’t match any existing value so it is empty and thus suppressed.

    I hope that answers your questions about using custom templates and suppressing the item captions. 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 in the plugin.

    Thread Starter luigsm

    (@luigsm)

    That worked great! Thanks!!!!

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the update with your good news. If there is anything else I can do, let me know.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘using different templates’ is closed to new replies.