The plugin allows you to assign the WordPress media library screen to specific table columns. The plugin will treat these columns as media columns everywhere throughout the plugin, including list tables, data entry forms, Data Publisher pages and Data Project pages.
In the example below (click image to enlarge) column image of table demo_products is defined as an image. From the data entry form of table demo_products user can select images from the WordPress media library and store them with a specific product.
The image setting above will result in the layout as shown in the publication below. Column attachments is a media column as well. You can store any media from the WordPress media library in these columns. They will be shown in the list table as hyperlinks.
|Brand||Brand Type||Color||Photo||Attachments||Price||Licence Plate||Category||Fuel Type||Mileage||Engine Capacity||No Cylinders||Brand||Brand Type||Color||Photo||Attachments||Price||Licence Plate||Category||Fuel Type||Mileage||Engine Capacity||No Cylinders|
How to define media columns
- Navigate to: WP Data Access > Data Explorer > Manage > Settings
- Click on Column Types
- Use the listbox to define the column media types
- Click on Save Table Settings
Media columns are associated with the WordPress media library throughout the plugin. The WordPress media library will be added to this column for all your:
- List tables
- Data entry forms
- Data Publisher pages
- Data Project pages
Supported types of media columns
The plugin reads the associated media data from your WordPress media library and adds the media to a list table or data entry form. The media type determines how the media is processed. Data entry forms provide the necessary functionality to upload, select and remove images to and from your WordPress media library.
Attachment columns can store any media from your WordPress media library. In a list table an attachment is shown as a link to the associated file. Media can be added in a data entry form in edit mode. In view mode the attachment is shown as a hyperlink.
Audio columns can only store audio from your WordPress media library. The plugin generates an audio shortcode for this type of media in list tables. Audio can be added in a data entry form in edit mode. In view mode an audio shortcode is added to the form.
Image columns can only store images from your WordPress media library. The plugin generates an img tag for this type of media in list tables. Images can be added in a data entry form in edit mode. In view mode an img tag is added to the form.
Video columns can only store video from your WordPress media library. The plugin generates an video shortcode for this type of media in list tables. Video can be added in a data entry form in edit mode. In view mode an video shortcode is added to the form.
Multiple and single media columns
The plugin supports multiple as well as single media columns:
- NUMBER columns are handled as single media columns
- VARCHAR columns are handled as multiple media columns
Single media columns can only save only one media id. Multiple media columns can save as many media id’s as you like. The width of your char column determines the maximum number of id’s that can be stored. Make sure your column is wide enough!
Column format examples
- column “bike_photo bigint(20) unsigned” can store one image or attachment
- column “bike_attachments varchar(200)” can store multiple images or attachments untill there is no more space left
- The association with the WordPress media library will only work within the plugin!
- Version 2.5.1 allowed to define media columns in the Data Publisher and Data Projects tools. From version 2.7.0 these settings are no longer available. Please transfer your media columns to your table settings as described above.
- Data entry for media columns is only available within the WordPress dashboard. Shortcode usage on web pages offers supports for WordPress media columns in list tables only.