• Resolved Harm10

    (@harm10)


    First of all I think you have created a huge improvement on regular gallery usage! So keep up the good work.

    Perhaps I am missing something obvious in the documentation but I cannot get the code right to get a page link from every image that is in my mla_gallery.

    My code is:
    [mla_gallery ids="1015,1074,1165" mla_caption="{+title+}" mla_link_href="{+site_url+}/?page_id={+mla_link_to_a_page+}"]
    The specific caption part works fine. On image id 1015 I added a custom field called “mla_link_to_a_page” and gave it a value (in this case 518).
    Still the link comes out like this:
    <a href="https://myurl.com/?page_id=[+mla_link_to_a_page+]">

    What am I doing wrong?

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

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

    (@dglingren)

    Thanks for the kind words and for your question. Thanks as well for including the full source text for your [mla_gallery]. You are very close to a solution.

    Fields like Title are built-in to the MLA logic and thus {+title+} works for you. Custom fields are an example of “Field-level Markup Substitution Parameters”, and you have to add a prefix to the field name so MLA knows where to look. You can read more about this in the Settings/Media Library Assistant Documentation tab. Try changing your shortcode parameter to:

    mla_link_href="{+site_url+}/?page_id={+custom:mla_link_to_a_page+}"

    I think that will get you the results you need. I am marking this topic resolved, but please update it if you have any problems or further questions about using custom fields in your [mla_gallery] shortcodes. Thanks for your interest in the plugin.

    Thread Starter Harm10

    (@harm10)

    Thanks for your quick response! Indeed it works when I put custom: as a prefix.

    I will investigate further what kind of logic can be built by studying the documentation further.

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom field usage?’ is closed to new replies.