Thanks for the positive feedback and for your question. Thanks as well for explaining how you use Lightroom to manage the sort order, which provides a motivation for the question.
You probably know that once the custom field is set up you can use it to sort the items in an [mla_gallery] shortcode. I’d be interested in your other uses for menu_order, which is one of the WordPress Standard Fields.
In any case, it might make sense to expand the set of Standard Fields available in the MLA IPTC/EXIF mapping rules and the Bulk Edit area. I will investigate the work required to do that and any associated risks.
You could also adapt the “MLA Simple Mapping Hooks Example” plugin to do the job. That example was developed for this earlier topic:
Using media Path to populate att. Category
I will leave this topic unresolved for now and post an update when I’ve completed my investigation on adding menu_order to the Standard Fields set. Thanks for your interest in the plugin.
Thread Starter
ciano
(@ciano)
Hi David,
Thanks for the quick response.
The reason I’m interested in menu_order is that the theme I use has the ability to show a slideshow of images as the background. It uses its own protocol in order to create a gallery in a page/post’s options. I found that to avoid sorting my photos three times (once in lightroom for my own use, once for the standard gallery, once for the themes background), I could use Enhanced Media Library to sort my photos and populate the menu_order field which both mla gallery and the theme take advantage of. This means I have just been sorting twice, once in Lightroom and once using Enhanced Media Library.
I’ve now discovered a way to export the sort order I use in Lightroom into the 2#103 IPTC field using a Lightroom plugin called L/R Transporter. This means that in theory I will only need to sort a gallery of images (a wedding for example) one time only in Lightroom, and then have that populated into the menu_order field and used automatically by both mla gallery and my theme.
The problem here of course is in actually getting it into the menu_order field. I had a look at the Mapping Hook Example and the link you posted me to, and started trying to amend it, but unfortunately I was way out of my depth and ended up spending a half hour going round in circles and scratching my head!
I’m happy enough for the time being to just use a static image as my post/page background, as the slideshow bg is just a nice but unnecessary extra. I can sort using a custom field in [mla_gallery] to display my Lightroom sort order. It would be really cool though if you managed to add menu_order to the standard mappings.
Thanks again for the help.
Thanks for your update and the detailed explanation of your application logic. After some deliberation I decided to add this feature to one of the MLA Example Plugins instead of embedding it in the MLA core.
I have released an MLA Development Version dated 20160811 that contains the updated example plugin. To get the Development Version, follow the instructions in this earlier topic:
Shortcode not working in (special) widget
After you install the Development Version you can easily install the example plugin. Navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. You will see a new submenu that lists all the example plugins and give you a “one-click” action for installing them. I hope this will make future installations of the example plugins more convenient for all MLA users.
You are looking for “MLA Simple Mapping Hooks Example” plugin. Find that plugin and hover over the title in the left-most column. Click the “Install” rollover action, then go to the Plugins/Installed Plugins submenu and activate it.
To put the new example to work you must define a new IPTC/EXIF mapping rule along the lines of your earlier rule for the “Test” custom field. Create a new rule and enter “update_menu_order” in the custom field name text box. Enter the other rule settings as you did for “Test”; make sure “Existing Text” is set to “Replace”.
Once that’s done you can use the “Add Field” to save the rule or the “Add Field and Map All Attachments” button to go back and set the menu_order field for your existing items, if that is appropriate. You can use the Media/Assistant Bulk Edit area or the Media/Edit Media screen to make more selective replacements. Look for the Map IPTC/EXIF Metadata button on either of those screens.
It would be great if you can install the Development Version and let me know how it works for you. I will leave this topic unresolved until I hear back from you.
I have released MLA Version 2.32, which includes the new example plugin that supports your application. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the solution outlined above. Thank you for your interest in the plugin.
Thread Starter
ciano
(@ciano)
I’ve just updated to MLA Version 2.32 and followed your instructions and am happy to report that everything is now working perfectly.
Thanks for the excellent help.