Support » Plugin: Media Library Assistant » Can it be done? DropDown list of chosen Image Titles

  • Resolved phil1ooo


    I have been trying to find out how to make this work if it is all possible.
    My Goal with this is when there is an option to upload images from members that are required to display say for example a team 6 used from a choice of over 200 players. Hope that makes sense.
    Reason for this is, in allowing 1000 plus members to each upload their own teams would mean my server would be full of duplicate images of the same characters as their is only those 200 to chose from.

    My idea is be able to provide something like a dropdown link of names (image titles) which when chosen would display the image associated with that title into an allocated slot on a particular specific pages/posts.

    Can this be done?


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


    Thanks for your question. I want to make sure I understand your goal, so let me re-state what I believe you need.

    You have about 200 images stored in the Media Library, representing players from which your users choose to form teams for some sort of sports application. You want to compose one or more dropdown lists of the image titles so users can choose from the available images/players. You want to display the images associated with the users’ choices on particular pages/posts. Is that right?

    The short answer is yes, this is a reasonable application and MLA can be of some help. You will, however, have to implement some code of your own to store and manage the users’ selected images.

    First, you can use MLA’s custom markup templates to compose a dropdown control containing the item Titles and IDs. Here is an earlier topic that does this for PDF documents; the logic for images is similar:

    Creating a dropdown list of PDF files

    The part of interest to you is the custom markup template and the HTML for the form that displays the controls. You could, for example, have 6 controls so the user could select an entire team. In this example, the form is submitted back to the original page that displayed it and the selections in the form are used to compose a gallery of the filtered items. For your application, the form would have to be submitted to some PHP code that captured the selections and stored the ID values in, for example, a user-specific custom variable. This code could be implemented as a custom shortcode that captures the selections and composes a gallery to display them. You could even put this shortcode on the same page as the entry form.

    To “display the image associated with that title” or all of the selected images you would have to write PHP code to retrieve the ID values and pass them to an [mla_gallery] shortcode that composes the gallery. One way to do this is to define your own shortcode in a small custom plugin. You can find one simple example of a custom shortcode in the “MLA Featured Field Shortcode Example” plugin. To get the example plugin, navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. Type “custom” in the text box and click “Search Plugins” to filter the table.

    You are looking for the “MLA Custom Taxonomy Example” plugin. Find that plugin and hover over the title in the left-most column. Click the “Install” (or “Update”) rollover action, then go to the WordPress Plugins/Installed Plugins submenu and activate the example plugin as you would any other plugin. You can also click the “Download” link to get a copy of the code for your own development, or click “View” to have a look at the code online.

    I hope these ideas are helpful for developing your application. I am marking this topic resolved, but please update it if you have problems or further questions regarding the above suggestions. I can answer questions you have about how MLA works, but I regret that I do not have the time to build out a complete demonstration of the code required for your specific application. Thanks for your interest in the plugin.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.