• Resolved yogogs

    (@yogogs)


    How can I add the link to file into the title instead of on the icon alone?

    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 your question, which has come up in this earlier topic:

    Attachment title as link

    Since that topic was addressed I have made a further improvement to eliminate the requirement for enclosing the shortcode in “code” tags. You can now use the alternate “enclosing shortcode” syntax to pass the HTML code into the shortcode:

    [mla_gallery post_parent=all post_mime_type="application/pdf" link=file size=icon mla_target="_blank"]
    mla_caption='<a href="{+file_url+}" target="_blank">{+title+}</a>'
    [/mla_gallery]
    

    Many variations on this basic idea are possible. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions or the earlier topic. Thanks for your interest in the plugin.

    Thread Starter yogogs

    (@yogogs)

    Should this be in the template or the post/page itself. Can’t seem to get it working. My current shortcode is below:

    [mla_gallery size=icon_only post_mime_type=application/pdf columns=2 mla_markup=pdf-table link=file post_parent=all attachment_category=’unliquidated-cash-advances’]

    Thread Starter yogogs

    (@yogogs)

    I got this error: ERROR: Invalid mla_gallery tax_query = ‘[mla_gallery’

    Thread Starter yogogs

    (@yogogs)

    I got it working this time by adding this code to my template:

    <a href="[+file_url+]">[+title+]</a>

    Thanks David. Great plugin!

    • This reply was modified 6 years, 2 months ago by yogogs.
    Plugin Author David Lingren

    (@dglingren)

    Thanks for your updates and for working through the solution on your own before I could respond.

    You asked “Should this be in the template or the post/page itself?” I regret that my example was not completely clear. The mla_caption parameter goes in the shortcode itself. For the shortcode you posted, it would look like:

    [mla_gallery size=icon_only post_mime_type=application/pdf columns=2 mla_markup=pdf-table link=file post_parent=all attachment_category='unliquidated-cash-advances']
    mla_caption='<a href="{+file_url+}" target="_blank">{+title+}</a>'
    [/mla_gallery]
    

    I’ve used the “enclosing shortcode” syntax, as in my earlier post.

    Adding the parameter to your template is a great alternative; you can use the template in as many shortcodes as you need to without duplicating the mla_caption parameter in each one.

    I will leave this topic resolved, but please update it if you have any other problems or questions. Thanks for your positive feedback on the plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Link in file instead of icon’ is closed to new replies.