Created
June 21, 2012 18:42
-
-
Save anointed/2967677 to your computer and use it in GitHub Desktop.
Radio Image type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Here is an example 'radio image' field type. | |
| Notice that we are giving the user a set number of choices for the sidebar via 'radio buttons', but instead of showing the text next to the radio box, we are showing an image. | |
| This is from http://leemason.github.com/NHP-Theme-Options-Framework/ | |
| One other question: | |
| Is there an ability to create a 'group' of repeating fields? | |
| i.e. | |
| group contains field types (text-title, image, description, etc) where I create that block of fields, and that entire block can repeat? | |
| Idea using metabox as a slideshow input, where the user gives each image a title and description. After inputting all the info for the image, click 'add another', where you get another field set. | |
| thanks so much for your time and for the great script. | |
| array( | |
| 'id' => 'default_single_post_layout', | |
| 'type' => 'radio_img', | |
| 'title' => __('default_single_post_layout', 'tumble'), | |
| 'sub_desc' => __('No validation can be done on this field type', 'tumble'), | |
| 'desc' => __('This uses some of the built in images, you can use them for layout options.', 'tumble'), | |
| 'options' => array( | |
| 'no-sidebar' => array('title' => 'No Sidebar', 'img' => NHP_OPTIONS_URL.'img/1col.png'), | |
| 'sidebar-left' => array('title' => 'Sidebar Left', 'img' => NHP_OPTIONS_URL.'img/2cl.png'), | |
| 'sidebar-right' => array('title' => 'Sidebar Right', 'img' => NHP_OPTIONS_URL.'img/2cr.png') | |
| ),//Must provide key => value(array:title|img) pairs for radio options | |
| 'std' => 'sidebar-left' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
We don't have the 'radio image' field type now. But you can achieve that by using one of the following filter:
Where
field_htmlis the HTML content of the field (<input>,<select>, etc.);idis the field ID,typeis the field type,fieldis the array of field attribute,metais the field value.For
groupof repeating fields, we haven't implemented it yet. So, it's not available now.