Redux Framework Sorter field: Output in template

456
March 18, 2017, at 09:07 AM
Redux Framework docu: docs.reduxframework.com/core/fields/sorter/

Backend

Screenshot: https://cloud.githubusercontent.com/assets/2229940/24063755/4aa146d2-0b61-11e7-88e4-7e00fa7b6831.png

redux-options-init.php

I'm just want to test the output from the foreach/switch, but there are no date to echo

    Redux::setSection( $opt_name, array(
'title'      => __( 'Sorter', 'redux-framework-demo' ),
'id'         => 'additional-sorter',
'subsection' => false,
'fields'     => array(
    array(
        'id'       => 'opt-homepage-layout',
        'type'     => 'sorter',
        'title'    => 'Layout Manager Advanced',
        'subtitle' => 'You can add multiple drop areas or columns.',
        'compiler' => 'true',
        'options'  => array(
            'enabled'  => array(
                'highlights' => 'Highlights',
                'slider'     => 'Slider',
                'staticpage' => 'Static Page',
                'services'   => 'Services'
            ),
            'disabled' => array(),
            'backup'   => array(),
        ),
        'limits'   => array(
            'disabled' => 1,
            'backup'   => 2,
        ),
    ),
    array(
        'id'       => 'opt-homepage-layout-2',
        'type'     => 'sorter',
        'title'    => 'Homepage Layout Manager',
        'desc'     => 'Organize how you want the layout to appear on the homepage',
        'compiler' => 'true',
        'options'  => array(
             'enabled'  => array(
                'highlights' => 'Highlights',
                'slider'     => 'Slider',
                'staticpage' => 'Static Page',
                'services'   => 'Services'
            ),
            'disabled' => array(
            ),
        ),
    ),
)
));

Template

Screenshot print_r:
https://cloud.githubusercontent.com/assets/2229940/24064732/78a142b2-0b66-11e7-8c2f-5cca3cecb775.png

I'm just want to test the output from the foreach/switch, but there are no date to echo

global $redux_data; 
echo 'Enabled column' . '<br />'; 
print_r ($redux_data['opt-homepage-layout-2']['enabled']);
echo '<br /><br />Disabled column' . '<br />'; 
print_r ($redux_data['opt-homepage-layout-2']['disabled']); 

global $redux_options;
$layout = $redux_options['opt-homepage-layout-2']['enabled'];
if ($layout): foreach ($layout as $key=>$value) {
    switch($key) {
        case 'slider': echo "slider";
        break;
        case 'highlights': echo "highlights";
        break;
        case 'services': echo "services";
        break;
        case 'staticpage': echo "services"; 
        break;  
    }
}
endif;
Rent Charter Buses Company
READ ALSO
convert mysql data to javascript chart with php

convert mysql data to javascript chart with php

Hello I would like to echo below table resut in php as javascript code, how can I do it ? With my codes I can not set commas between rows result is ; data: [ [012017,9000],[] ->> last square brackets demolish code

352
Warning: get_meta_tags(): failed to open stream: Network is unreachable?

Warning: get_meta_tags(): failed to open stream: Network is unreachable?

When i try to use get_meta_tags(); it gives me a error Warning: get_meta_tags(): failed to open stream: Network is unreachable

592
Custom Body Class from URI

Custom Body Class from URI

I'm working on how to get a custom class into my body tagI'd like to parse the URI and drop each part of the URI into the class as a separate string

285
I have issue with back button - Making a Similar website to youtube

I have issue with back button - Making a Similar website to youtube

My code is based on youtube (i'm trying to figure out how youtube work) but there is problem with back button - i need to click back button 2 times to work and when i use back i cant use forward button again

277