Input Helpers
(Since 1.6.4) -- customize the appearance of an input field
An Input Helper lets you completely customize the appearance of any input field.
The default input field code is generated from: /plugins/pods/ui/input_fields.php
Create an Input Helper
- Go to Pods > Setup
- Click on the "Helpers" tab
- Click on the blue "Add new helper" button
- Give your helper a name (alphanumeric and underscores only)
- Select "Input" from the dropdown, then hit Save
- Add some helper code into the subsequent textarea, then hit Save
How to Assign
- In "Manage Pods", there is a dropdown under "Pod Settings" when selecting the pod of your choosing.
- When using the publicForm function, you can manually choose an input helper to use (see examples)
Available Variables / Data
- $name - The column name
- $value - The column's value (if editing, or if default is set)
- $coltype - The column's type
- $coltype_exists[$coltype] - Can be used to check if a column has been used more than once, useful for when needing to include a function / script / css
- $hidden - If a column is hidden or not
- $comment - The column's comment
- $css_id - The column's css ID, used with label / form element
- $field - An array of all settings related to the current column, as found in wp_pod_fields
- $field['multiple'] - Value is 1 if allowed to pick more than one, otherwise it is 0
- $value - Contains an array of the available rows from the related PICK column's Pod
- $value[$index] - In this case, $index is the array key of the item, $index is not a usable variable, it's only used as an example in this context
- $value[$index]['id'] - The ID of the Pod item
- $value[$index]['name'] - The name of the Pod item
- $value[$index]['active'] - If not empty, the current Pod item has been selected
- $value[$index]['other_column_name'] - Other columns from the Pod are available, just not the Pod's PICK columns themselves
Examples
Disable a text field
We're simply copying TEXT field code from ui/input_fields.php and adding the "disabled" HTML attribute.
