redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

About image_selet field

Open genethic opened this issue 12 years ago • 3 comments

Hi! I am a bit confused about image_select field. I was trying to create an option for select a layout on my theme using images. I was thinking that this options was like a simple radio option with images as label, but the output of the option is the image url. If there a way to output the option key and not the value?

This is my field:

array( 'id' => 'layout', 'type' => 'image_select', 'title' => __('Layout', 'nmd'), 'subtitle' => __('Blog archives page layout.', 'nmd'), 'options' => array( 'left' => array('title' => 'Left', 'img' => ReduxFramework::$_url . '../sample/patterns/2cl.png'), 'right' => array('title' => 'Right', 'img' => ReduxFramework::$_url . '../sample/patterns/2cr.png'),
'full' => array('title' => 'Full', 'img' => ReduxFramework::$_url . '../sample/patterns/1col.png'), ), 'default' => 'right' ),

I want this to output "left", "right" and "full", can I achieve this with redux?

Thanks

genethic avatar Oct 02 '14 18:10 genethic

I think you just have your syntax wrong. Here's the documentation for the field.

http://docs.reduxframework.com/core/fields/image-select/

It's all there. :)

dovy avatar Oct 02 '14 18:10 dovy

Yes, sorry i was confused with select_img field..

genethic avatar Oct 02 '14 18:10 genethic

select_image is for selecting a field. image_select is for selecting a value using images. :)

dovy avatar Oct 02 '14 18:10 dovy