Thanks for your question and for adding a link to the relevant page on your site; very helpful.
As you’ve discovered, the current MLA version refreshes the page when you click any of the pagination links. I do not have a technique to “maintain the scroll position” exactly, but I can offer a reasonable alternative.
You can add HTML “anchor” tags just above each gallery and then add the tag id to each link in the pagination controls. You can also use separate “current page” parameters for each gallery so they can be navigated independently. Here is an example that includes both techniques:
<a name="admin-gallery"></a>
<h3>Admin Gallery</h3>
[mla_gallery]
post_parent=all post_mime_type=application/pdf size=icon link=file attachment_category=admin posts_per_page=2 mla_caption="{+file+}"
[/mla_gallery]
Go to page: [mla_gallery]
post_parent=all post_mime_type=application/pdf attachment_category=admin posts_per_page=2 mla_output="paginate_links,show_all" mla_link_href="{+new_url+}#admin-gallery"
[/mla_gallery]
<a name="teacher-gallery"></a>
<h3>Teachers Gallery</h3>
[mla_gallery]
post_parent=all post_mime_type=application/pdf
attachment_category=teachers
size=icon link=file posts_per_page=1 mla_caption="{+file+}"
mla_page_parameter="mla_paginate_current_2"
[/mla_gallery]
Go to page: [mla_gallery]
post_parent=all post_mime_type=application/pdf
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+}#teacher-gallery"
[/mla_gallery]
I have used the alternate “enclosing shortcode” syntax to break the parameters over several lines for readability. Look at the second set of shortcodes for the Teachers Gallery:
- Just above the heading is the HTML anchor tag,
<a name="teacher-gallery"></a>
(you can use <a id="teacher-gallery"></a>
for HTML5).
- The
mla_page_parameter="mla_paginate_current_2"
parameter has been added to both of the shortcodes. This gives the second gallery its own current page parameter.
- The
mla_link_href="{+new_url+}#teacher-gallery"
parameter appends the anchor tag value to all of the pagination links. When the page refreshes it will scroll to put the gallery heading at the top of the visible page.
I hope that gets you started on a solution for your application. 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.