• Resolved willemb2

    (@willemb2)


    I’m testing MLA to make an archive of our club magazine (PDF) available. I have little experience with shortcodes and parameters, so I’m very impressed by the all the possibilities and still a bit overwhelmed by the complexity of MLA. The first result looks promising though.

    What doesn’t work yet:
    1. Let the PDF’s open in a new tab. I used mla_target="_blank" but that doesn’t work.

    2. I also would like to make the titles appear in a larger font and maybe bold, not italic. It looks like the styling of mla_cation is the same as the theme’s styling for image captions. Is there a way to show bigger title without affecting the image captions on the rest of the site?

    Below is the full shortcode I used on that page.

    [mla_gallery]
    
    mla_caption="{+title+}" meta_key="bparch" meta_value="1" post_mime_type=application/pdf post_parent=all link=file mla_target="_blank" mla_viewer=true size="medium" columns=3 posts_per_page=30 orderby="title ASC" last_page=9
    
    [/mla_gallery]
    
    [mla_gallery mla_caption="{+title+}" meta_key="bparch" meta_value="1" post_mime_type=application/pdf post_parent=all posts_per_page=30 mla_output="paginate_links,prev_next" mla_paginate_total=9 mla_nolink_text='No Gallery Pages']

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

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

    (@dglingren)

    Thanks for the positive feedback and for your questions. I know MLA can be complex and I appreciate your efforts to make it work for you.

    Thanks as well for including the source text of your shortcodes and the link to your test gallery page; very helpful.

    First, regarding the mla_target="_blank" issue. I visited your page and it looks like your theme is rewriting the [mla_gallery] URLs, eliminating the target="_blank" attribute. You will have to work with your theme’s developers to resolve that issue. If they need my help you or they can contact me at my web site.

    Second, you wrote “I also would like to make the titles appear in a larger font and maybe bold, not italic.” You can apply any CSS styles you like to your gallery by creating a custom style template. You can also change he HTML content with a custom markup template. You can find more information about both in the “Style and Markup Templates” section of the Settings/Media Library Assistant Documentation tab. A custom markup template might also be a solution for your mla_target="_blank" issue. You can change the class attributes to avoid applying the theme’s styles and URL rewrite logic.

    I will leave this topic unresolved for now in case you have problems or further questions regarding the above suggestions. Thanks for your interest in the plugin.

    Thread Starter willemb2

    (@willemb2)

    Thanks, David! I managed to create a custom style template. My first steps in the world of CSS! I found out that I needed to add !important behind all the properties I added to make them escape from the theme’s straight jacket. Now the titles look perfect.

    I’m still confused about markup templates. Should I add my own class behind [+link+]? How do I create that? Probably this is still a bridge too far for me. My reviewers suggested to add “Use Ctrl+click to open in a new tab” above the page. We might just do that in the final version.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update with the good news on your progress.

    Regarding the title display, your solution using the style sheet for your child theme seems fine to me (although I am not a CSS expert by any means).

    Regarding the mla_target="_blank" issue, you do not need to create a custom markup template. I have taken a closer look at your gallery test page and found an MLA defect. The content of the [+link+] element comes from a WordPress function, wp_get_attachment_link(). It looks like your Avada theme is using the filters in this function to rewrite the link content; here’s an example:

    <a data-title="Bokkepoot 005" data-caption="
    	Bokkepoot 005
    	" href="https://www.lvbhb.nl/wp-content/uploads/2022/04/Bokkepoot-005.pdf" class="fusion-no-lightbox"><img aria-describedby="mla_gallery-1-25126" width="212" height="300" src="https://www.lvbhb.nl/wp-content/uploads/2022/04/Bokkepoot-005-pdf-212x300.jpg" class="attachment-medium size-medium" alt=""></a>
    

    The current MLA version does not expect attributes such as data-title and data-caption to precede the href= attribute. MLA fails to insert its own attributes, e.g., target="_blank", in this case.

    I have uploaded a new MLA Development Version dated 20220614 that corrects the problem. You can find step-by-step instructions for using the Development Version in this earlier topic:

    PHP Warning on media upload with Polylang

    Once the Development Version is installed you can retest the handling of mla_target="_blank" in your test gallery page.

    The fix will be part of my next MLA version, but in the interim it would be great if you could install the Development Version and let me know if it works for you. Thanks for alerting me to this MLA defect.

    Thread Starter willemb2

    (@willemb2)

    David, you’re a genius! 20220614 does the job just perfect. We’re in production (on another page including Ajax search on the PDF’s) and people love it. Thank you so much!

    Plugin Author David Lingren

    (@dglingren)

    Thanks for confirming that the Development Version worked for you. I have released MLA version 3.00, which contains the fixes required for this topic.

    I am leaving this topic resolved. Thanks for alerting me to the problem and for testing the solution.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘mla_target=”_blank” not working as I would expect’ is closed to new replies.