Thanks for another interesting question – there is no such thing as “too many”; I always learn something and frequently get new ideas for MLA features.
You can add gallery-specific links and anchors to your application by making two changes:
- Define a custom markup template that adds an HTML anchor tag (
<a name='[+selector+]'>
) to the beginning of the “Open” section, e.g.,
<a name='[+selector+]'>
<div id='[+selector+]' class='gallery galleryid-[+id+] gallery-columns-[+columns+] gallery-size-[+size_class+]'>
You can find more information on creating custom templates in the Documentation tab.
- Add the anchor reference to your pagination
[mla_gallery]
shortcodes, e.g.,
mla_link_href="{+new_url+}#mla_gallery-1"
You’ll have to modify the “mla_gallery-1” portion to reference the gallery you want.
There’s a little MLA bug that adds an extra parameter to the links, but it doesn’t seem to affect the outcome. I will correct it in my next MLA version.
Don’t forget to add the custom template parameter to your “gallery display” [mla_gallery]
shortcodes. Here is an updated version of the “two paginated galleries” example showing the shortcode modifications:
[mla_gallery attachment_category=admin posts_per_page=2 mla_markup=anchor]
Go to page: [mla_gallery attachment_category=admin posts_per_page=2 mla_output="paginate_links,show_all" mla_link_href="{+new_url+}#mla_gallery-1"]
----------
[mla_gallery attachment_category=teachers posts_per_page=1 mla_page_parameter="mla_paginate_current_2" mla_markup=anchor]
Go to page: [mla_gallery attachment_category=teachers posts_per_page=1 mla_output="paginate_links,show_all" mla_page_parameter="mla_paginate_current_2" mla_link_href="{+new_url+}#mla_gallery-3"]
You can see that the two “gallery” shortcodes are mla_gallery-1
and mla_gallery-3
, and that my custom markup template is called “anchor”.
I am marking this topic resolved, but please update it if you have any problems with the above suggestions or you need more specific help on creating a custom markup template.