Support » Plugin: Media Library Assistant » displaying ACF values in front end

  • Resolved irving.bos

    (@irvingbos)


    Hi David, I am using ACF plugin to add a number of fields (tel#, address) to media in a certain att-category. That part is (sort of) working; i cant get the extra fields to show for edit *only* when the att-category is “photo-directory’, but I can live with that for now.
    Is there a guide / tutorial on how to display these extra fields in the front end via the [mla_gallery] shortcode?

    thanks,
    irving

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

    (@dglingren)

    Thanks for the question. ACF has come up in some earlier topics:

    ACF Fields in Quick Edit / Bulk Edit

    Bulk Edit Custom Field/ACF Fields

    Advanced Custom Fields repeater

    You can see from the earlier topics that 1) ACF fields are stored as WordPress custom fields, and 2) many of the ACF field types require additional code for interpretation and display.

    You might find something of value in the “MLA Advanced Custom Fields 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 Advanced Custom Fields Example” plugin (which contains all the code in the “MLA ACF Checkbox 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.

    For [mla_gallery], some simple ACF formats can be displayed using the custom:acf_ prefix. You will have to know the “Field Label” for this purpose, not the “Field Name”. For more complex formats You can use the hooks provided for the [mla_gallery] shortcode to convert the custom field content to a displayable value. For example, “image” fields contain the ID of the associated Media Library item, relationship and taxonomy fields contain PHP serialized arrays with format-specific elements.

    I can give you more specific guidance if I know more about the fields and types you are using in your application. I will leave this topic unresolved while you digest the above information.

    Plugin Author David Lingren

    (@dglingren)

    It has been over a month since my last post. I am marking this topic resolved, but please update it if you have problems or further questions regarding the display of ACF fields in the gallery display generated by [mla_gallery].

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