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

image_select field not outputting the selector on header output

Open SilverKenn opened this issue 12 years ago • 5 comments

Notice something on this img select field

array(
                        'id' => 'body_bg_img',
                        'type' => 'image_select',
                        'tiles' => true,
                        'title' => __('Images Option (with pattern=>true)', 'cmk-framework'),
                        'subtitle' => __('Select a background pattern.', 'cmk-framework'),
                        'default' => 0,
                        'output' => array('#wrap'),
                        'compiler' => array('#wrap'),
                        'options' => array(1,2,3),//$sample_patterns,
                    ),

header output result

background-image: url('3'); /** No selector **/

compiler result

#wrap{background-image: url('3');} /** working properly **/

Not a big issue for me as I am only using header output for testing purposes, Just feel to report it though

Cheers, Kenn

SilverKenn avatar Mar 13 '14 16:03 SilverKenn

Your options are numbers, therefore, that is what is outputted.

kprovance avatar Mar 13 '14 17:03 kprovance

lol. I only changed it in here so not getting long name ;)

its the css selector output is the problem not outputting on the header e.g. .my-css-selector { }

just to clarify here's the actual code

array(
                        'id' => 'body_bg_img',
                        'type' => 'image_select',
                        'tiles' => true,
                        'title' => __('Images Option (with pattern=>true)', 'cmk-framework'),
                        'subtitle' => __('Select a background pattern.', 'cmk-framework'),
                        'default' => 0,
                        'output' => array('#wrap'),
                        'compiler' => array('#wrap'),
                        'options' => $sample_patterns,
                    ),

header output

background-image: url('http://localhost/wp/gantry/wp-content/themes/cmk/config/framework/cmk-options/patterns/pattern3.png'); /** No selector **/

Compiler Output

#wrap{background-image: url(''http://localhost/wp/gantry/wp-content/themes/cmk/config/framework/cmk-options/patterns/pattern3.png');}/** working properly **/

Hope you get my point.

Thanks

SilverKenn avatar Mar 13 '14 17:03 SilverKenn

I see the problem. Missing variable in the code. I'll push a fix in a few minutes. :)

kprovance avatar Mar 13 '14 18:03 kprovance

Done. I didn't change the version number, but the code has been updated. :)

kprovance avatar Mar 13 '14 18:03 kprovance

Thank you so much,

As always, Redux support is excellent.

Happy Coding.. :+1:

Cheers, Kenn

SilverKenn avatar Mar 13 '14 18:03 SilverKenn