reduxframework / redux-framework

Redux is a simple, truly extensible options framework for WordPress themes and plugins!
http://redux.io
Other
1.73k stars 582 forks source link

Sort Feature #336

Closed ghost closed 10 years ago

ghost commented 10 years ago

Hello guys. I am using Redux as my framework for a wordpress theme and I would like to use sort blocks for my onepage layout but I dont see any block in my theme options at wordpress dashboard... Why is that cuz I have them defined in my sample-config.php. Please help me

dovy commented 10 years ago

Umm, you're going to have to give me more than that to debug. How about your config file so I can test and the exact steps?

Thanks!

ghost commented 10 years ago

<?php

/ ReduxFramework Sample Config File For full documentation, please visit http://reduxframework.com/docs/ /

/**

Most of your editing will be done in this section.

Here you can override default values, uncomment args and change their values.
No $args are required, but they can be overridden if needed.

**/ $args = array();

// For use with a tab example below $tabs = array();

ob_start();

$ct = wp_get_theme(); $theme_data = $ct; $item_name = $theme_data->get('Name'); $tags = $ct->Tags; $screenshot = $ct->get_screenshot(); $class = $screenshot ? 'has-screenshot' : '';

$customize_title = sprintf( __( 'Customize “%s”','de' ), $ct->display('Name') );

?>

<?php esc_attr_e( 'Current theme preview' ); ?> <?php esc_attr_e( 'Current theme preview' ); ?>

display('Name'); ?>

  • display('Author') ); ?>
  • display('Version') ); ?>
  • '.__('Tags', 'de').': '; ?>display('Tags') ); ?>

display('Description'); ?>

parent() ) { printf( '

' . __( 'This child theme requires its parent theme, %2$s.' ) . '

', __( 'http://codex.wordpress.org/Child_Themes','de' ), $ct->parent()->display( 'Name' ) ); } ?>

<?php $item_info = ob_get_contents();

ob_end_clean();

$sampleHTML = ''; if( file_exists( dirname(FILE).'/info-html.html' )) { /* @global WP_Filesystem_Direct $wp_filesystem / global $wp_filesystem; if (empty($wp_filesystem)) { require_once(ABSPATH .'/wp-admin/includes/file.php'); WP_Filesystem(); }
$sampleHTML = $wp_filesystem->get_contents(dirname(FILE).'/info-html.html'); }

// BEGIN Sample Config

// Setting dev mode to true allows you to view the class settings/info in the panel. // Default: true $args['dev_mode'] = true;

// Set the icon for the dev mode tab. // If $args['icon_type'] = 'image', this should be the path to the icon. // If $args['icon_type'] = 'iconfont', this should be the icon name. // Default: info-sign //$args['dev_mode_icon'] = 'info-sign';

// Set the class for the dev mode tab icon. // This is ignored unless $args['icon_type'] = 'iconfont' // Default: null $args['dev_mode_icon_class'] = 'icon-large';

// Set a custom option name. Don't forget to replace spaces with underscores! $args['opt_name'] = 'de7igner_options';

// Setting system info to true allows you to view info useful for debugging. // Default: false //$args['system_info'] = true;

// Set the icon for the system info tab. // If $args['icon_type'] = 'image', this should be the path to the icon. // If $args['icon_type'] = 'iconfont', this should be the icon name. // Default: info-sign //$args['system_info_icon'] = 'info-sign';

// Set the class for the system info tab icon. // This is ignored unless $args['icon_type'] = 'iconfont' // Default: null $args['system_info_icon_class'] = 'icon-large';

$theme = wp_get_theme();

$args['display_name'] = $theme->get('Name'); //$args['database'] = "theme_mods_expanded"; $args['display_version'] = $theme->get('Version');

// If you want to use Google Webfonts, you MUST define the api key. $args['google_api_key'] = 'AIzaSyAX_2L_UzCDPEnAHTG7zhESRVpMPS4ssII';

// Define the starting tab for the option panel. // Default: '0'; //$args['last_tab'] = '0';

// Define the option panel stylesheet. Options are 'standard', 'custom', and 'none' // If only minor tweaks are needed, set to 'custom' and override the necessary styles through the included custom.css stylesheet. // If replacing the stylesheet, set to 'none' and don't forget to enqueue another stylesheet! // Default: 'standard' //$args['admin_stylesheet'] = 'standard';

// Setup custom links in the footer for share icons $args['share_icons']['twitter'] = array( 'link' => 'http://twitter.com/ghost1227', 'title' => 'Follow me on Twitter', 'img' => ReduxFramework::$_url . 'assets/img/social/Twitter.png' ); $args['share_icons']['linked_in'] = array( 'link' => 'http://www.linkedin.com/profile/view?id=52559281', 'title' => 'Find me on LinkedIn', 'img' => ReduxFramework::$_url . 'assets/img/social/LinkedIn.png' );

// Enable the import/export feature. // Default: true //$args['show_import_export'] = false;

// Set the icon for the import/export tab. // If $args['icon_type'] = 'image', this should be the path to the icon. // If $args['icon_type'] = 'iconfont', this should be the icon name. // Default: refresh //$args['import_icon'] = 'refresh';

// Set the class for the import/export tab icon. // This is ignored unless $args['icon_type'] = 'iconfont' // Default: null $args['import_icon_class'] = 'icon-large';

/**

// Set a custom menu icon. //$args['menu_icon'] = '';

// Set a custom title for the options page. // Default: Options $args['menu_title'] = __('Options', 'de');

// Set a custom page title for the options page. // Default: Options $args['page_title'] = __('Options', 'de');

// Set a custom page slug for options page (wp-admin/themes.php?page=***). // Default: redux_options $args['page_slug'] = 'redux_options';

$args['default_show'] = true; $args['default_mark'] = '*';

// Set a custom page capability. // Default: manage_options //$args['page_cap'] = 'manage_options';

// Set the menu type. Set to "menu" for a top level menu, or "submenu" to add below an existing item. // Default: menu //$args['page_type'] = 'submenu';

// Set the parent menu. // Default: themes.php // A list of available parent menus is available at http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters //$args['page_parent'] = 'options_general.php';

// Set a custom page location. This allows you to place your menu where you want in the menu order. // Must be unique or it will override other items! // Default: null //$args['page_position'] = null;

// Set a custom page icon class (used to override the page icon next to heading) //$args['page_icon'] = 'icon-themes';

// Set the icon type. Set to "iconfont" for Elusive Icon, or "image" for traditional. // Redux no longer ships with standard icons! // Default: iconfont //$args['icon_type'] = 'image';

// Disable the panel sections showing as submenu items. // Default: true //$args['allow_sub_menu'] = false;

// Set ANY custom page help tabs, displayed using the new help tab API. Tabs are shown in order of definition. $args['help_tabs'][] = array( 'id' => 'redux-opts-1', 'title' => ('Theme Information 1', 'de'), 'content' => ('

This is the tab content, HTML is allowed.

', 'de') ); $args['help_tabs'][] = array( 'id' => 'redux-opts-2', 'title' => ('Theme Information 2', 'de'), 'content' => ('

This is the tab content, HTML is allowed.

', 'de') );

// Set the help sidebar for the options page.
$args['help_sidebar'] = __('

This is the sidebar content, HTML is allowed.

', 'de');

// Add HTML before the form. if (!isset($args['global_variable']) || $args['global_variable'] !== false ) { if (!empty($args['global_variable'])) { $v = $args['global_variable']; } else { $v = strreplace("-", "", $args['opt_name']); } $args['intro_text'] = sprintf( __('

De7igner – Flat iOS7 Inspired Coming Soon Template is a fully configurable and easy to use responsive under construction template with HTML5 Video Background Support and a lot of other great features. It has been specifically designed to be easily customized and it’s created for creatives who want to make under construction page in few minutes.', 'de' ), $v ); } else { $args['intro_text'] = __('

This text is displayed above the options panel. It isn\'t required, but more info is always better! The intro_text field accepts all HTML.

', 'de'); }

// Add content after the form. $args['footer_text'] = __('

This text is displayed below the options panel. It isn\'t required, but more info is always better! The footer_text field accepts all HTML.

', 'de');

// Set footer/credit line. //$args['footer_credit'] = __('

This text is displayed in the options panel footer across from the WordPress version (where it normally says \'Thank you for creating with WordPress\'). This field accepts all HTML.

', 'de');

$sections = array();

//Background Patterns Reader $sample_patterns_path = ReduxFramework::$_dir . '../sample/patterns/'; $sample_patterns_url = ReduxFramework::$_url . '../sample/patterns/'; $sample_patterns = array();

if ( is_dir( $sample_patterns_path ) ) :

if ( $sample_patterns_dir = opendir( $sample_patterns_path ) ) : $sample_patterns = array();

while ( ( $sample_patterns_file = readdir( $sample_patterns_dir ) ) !== false ) {

  if( stristr( $sample_patterns_file, '.png' ) !== false || stristr( $sample_patterns_file, '.jpg' ) !== false ) {
    $name = explode(".", $sample_patterns_file);
    $name = str_replace('.'.end($name), '', $sample_patterns_file);
    $sample_patterns[] = array( 'alt'=>$name,'img' => $sample_patterns_url . $sample_patterns_file );
  }
}

endif; endif;

$sections[] = array( 'title' => ('Home Settings', 'de'), 'header' => ('Welcome to the Simple Options Framework Demo', 'de'), 'desc' => __('', 'de'), 'icon_class' => 'icon-large', 'icon' => 'home', // 'submenu' => false, // Setting submenu to false on a given section will hide it from the WordPress sidebar menu! 'fields' => array(

    array(
        'id'=>'logo',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Upload Your Logo Here', 'de'),
        'compiler' => 'true',
        'desc'=> __('Here you can upload your logo from Wordpress Media Uploader.', 'de'),
        'subtitle' => __('Upload Logo', 'de'),
    ),

    array(
        'id'=>'preloader',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Upload Your Preloader Here', 'de'),
        'compiler' => 'true',
        'desc'=> __('Here you can upload your preloader from Wordpress Media Uploader.', 'de'),
        'subtitle' => __('Upload Preloader', 'de'),
    ),

    array(
        'id'=>'bg-image',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Upload Homepage Background Image', 'de'),
        'compiler' => 'true',
        'desc'=> __('Here you can upload your background image from Wordpress Media Uploader.', 'de'),
        'subtitle' => __('Upload Preloader', 'de'),
    ),

    array(
        'id'=>'cubes-wrapp',
        'type' => 'checkbox',
        'title' => __('Show Cubes on Homepage', 'de'), 
        'subtitle' => __('Switch it!', 'de'),
        'desc' => __('Check it if you want to use animated cubes on your Homepage!', 'de'),
        'default' => '1'// 1 = on | 0 = off
        ),

    array(
        'id'=>'twitter-url',
        'type' => 'text',
        'title' => __('Twitter URL', 'de7igner'),
        'subtitle' => __('This must be a URL.', 'de7igner'),
        'desc' => __('URL goes here', 'de7igner'),
        'validate' => 'url',
        'default' => 'https://twitter.com/'
    ),

    array(
        'id'=>'facebook-url',
        'type' => 'text',
        'title' => __('Facebook URL', 'de7igner'),
        'subtitle' => __('This must be a URL.', 'de7igner'),
        'desc' => __('URL goes here', 'de7igner'),
        'validate' => 'url',
        'default' => 'https://www.facebook.com/'
    ),

    array(
        'id'=>'vimeo-url',
        'type' => 'text',
        'title' => __('Vimeo URL', 'de7igner'),
        'subtitle' => __('This must be a URL.', 'de7igner'),
        'desc' => __('URL goes here', 'de7igner'),
        'validate' => 'url',
        'default' => 'https://vimeo.com/'
    ),

    array(
        'id'=>'dribbble-url',
        'type' => 'text',
        'title' => __('Dribbble URL', 'de7igner'),
        'subtitle' => __('This must be a URL.', 'de7igner'),
        'desc' => __('URL goes here', 'de7igner'),
        'validate' => 'url',
        'default' => 'http://dribbble.com/'
    ),

    array(
        'id'=>'linkedin-url',
        'type' => 'text',
        'title' => __('LinkedIn URL', 'de7igner'),
        'subtitle' => __('This must be a URL.', 'de7igner'),
        'desc' => __('URL goes here', 'de7igner'),
        'validate' => 'url',
        'default' => 'https://www.linkedin.com/'
    ),

    array(
        'id'=>'square-one',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Square Image One', 'de'),
        'compiler' => 'true',
        'desc'=> __('Upload First Homepage Square Image', 'de'),
        'subtitle' => __('Upload Square Image', 'de'),
    ),

    array(
        'id'=>'square-two',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Square Image Two', 'de'),
        'compiler' => 'true',
        'desc'=> __('Upload Second Homepage Square Image', 'de'),
        'subtitle' => __('Upload Square Image', 'de'),
    ),

    array(
        'id'=>'square-three',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Square Image Three', 'de'),
        'compiler' => 'true',
        'desc'=> __('Upload Third Homepage Square Image', 'de'),
        'subtitle' => __('Upload Square Image', 'de'),
    ),

    array(
        'id'=>'square-four',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Square Image Four', 'de'),
        'compiler' => 'true',
        'desc'=> __('Upload Fourth Homepage Square Image', 'de'),
        'subtitle' => __('Upload Square Image', 'de'),
    ),

    array(
        'id'=>'twitter-user',
        'type' => 'text',
        'title' => __('Twitter Username', 'de7igner'),
        'subtitle' => __('Enter your username', 'de7igner'),
        'desc' => __('Username goes here', 'de7igner'),
        'default' => 'avathemes'
    ),

),

);

$sections[] = array( 'icon' => 'cogs', 'icon_class' => 'icon-large', 'title' => __('Vision Block Settings', 'de'), 'fields' => array(

    array(
        'id'=>'vision-title',
        'type' => 'text',
        'title' => __('Vision Block Title', 'de7igner'),
        'subtitle' => __('Enter Description', 'de7igner'),
        'desc' => __('Title goes here', 'de7igner'),
        'default' => 'Our Vision'
    ),

    array(
        'id'=>'vision-description',
        'type' => 'text',
        'title' => __('Vision Block Description', 'de7igner'),
        'subtitle' => __('Enter Description', 'de7igner'),
        'desc' => __('Description goes here', 'de7igner'),
        'default' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Veritatis, ex.'
    ),

    array(
        'id'=>'vision-button',
        'type' => 'text',
        'title' => __('Vision Button URL', 'de7igner'),
        'subtitle' => __('Enter URL', 'de7igner'),
        'desc' => __('URL goes here', 'de7igner'),
        'default' => '#'
    ),

)

);

$sections[] = array( 'icon' => 'cogs', 'icon_class' => 'icon-large', 'title' => __('Testimonials Parallax Block', 'de'), 'fields' => array(

    array(
        'id'=>'parallax-testimonial-title',
        'type' => 'text',
        'title' => __('Block Title', 'de7igner'),
        'subtitle' => __('Enter Title', 'de7igner'),
        'desc' => __('Title goes here', 'de7igner'),
        'default' => 'Testimonials'
    ),

    array(
        'id'=>'testimonial-block-bg',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Block Background Image', 'de'),
        'compiler' => 'true',
        'desc'=> __('Upload Parallax block image', 'de'),
        'subtitle' => __('Upload Image', 'de'),
    ),

)

);

$sections[] = array( 'icon' => 'cogs', 'icon_class' => 'icon-large', 'title' => __('Design Parallax Block', 'de'), 'fields' => array(

    array(
        'id'=>'design-block-bg',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Block Background Image', 'de'),
        'compiler' => 'true',
        'desc'=> __('Upload Parallax block image', 'de'),
        'subtitle' => __('Upload Image', 'de'),
    ),

    array(
        'id'=>'design-block-img',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Block Content Image', 'de'),
        'compiler' => 'true',
        'desc'=> __('Upload Parallax Content Image', 'de'),
        'subtitle' => __('Upload Image', 'de'),
    ),

)

);

$sections[] = array( 'icon' => 'cogs', 'icon_class' => 'icon-large', 'title' => __('Typography Parallax Block', 'de'), 'fields' => array(

    array(
        'id'=>'typography-block-bg',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Block Background Image', 'de'),
        'compiler' => 'true',
        'desc'=> __('Upload Parallax block image', 'de'),
        'subtitle' => __('Upload Image', 'de'),
    ),

    array(
        'id'=>'typography-block-img',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Block Content Image', 'de'),
        'compiler' => 'true',
        'desc'=> __('Upload Parallax Content Image', 'de'),
        'subtitle' => __('Upload Image', 'de'),
    ),

)

);

$sections[] = array( 'icon' => 'cogs', 'icon_class' => 'icon-large', 'title' => __('Good Players Parallax Block', 'de'), 'fields' => array(

    array(
        'id'=>'players-block-bg',
        'type' => 'media', 
        'url'=> true,
        'title' => __('Block Background Image', 'de'),
        'compiler' => 'true',
        'desc'=> __('Upload Parallax block image', 'de'),
        'subtitle' => __('Upload Image', 'de'),
    ),

    array(
        'id'=>'players-text',
        'type' => 'text',
        'title' => __('Enter text for Parallax Block', 'de7igner'),
        'subtitle' => __('Enter text', 'de7igner'),
        'desc' => __('Use <span></span> tags between the words you want to uppercase!', 'de7igner'),
        'default' => 'Finding <span>good players</span> is easy. <br> Getting them <span>to play</span> as <span>a team</span> <br> is another story.'
    ),

)

);

$sections[] = array( 'type' => 'divide', );

$sections[] = array( 'icon' => 'cogs', 'icon_class' => 'icon-large', 'title' => __('General Settings', 'de'), 'fields' => array(

    array(
        "id" => "homepage_blocks",
        "type" => "sorter",
        "title" => "Homepage Layout Manager",
        "desc" => "Organize how you want the layout to appear on the homepage",
        "compiler"=>'true',
        'required' => array('switch-fold','equals','0'),    
        'options' => array(
            "enabled" => array(
                "placebo" => "placebo", //REQUIRED!
                "highlights" => "Highlights",
                "slider" => "Slider",
                "staticpage" => "Static Page",
                "services" => "Services"
            ),
            "disabled" => array(
                "placebo" => "placebo", //REQUIRED!
            )
        ),
    ),

    array(
        'id'=>'about-page',
        'type' => 'select',
        'data' => 'pages',
        'title' => __('About Page Select Option', 'de'), 
        'subtitle' => __('Select Page', 'de'),
        'desc' => __('Create About page and Select it for displaying in a about block template', 'de'),
    ),

    array(
        'id'=>'team-page',
        'type' => 'select',
        'data' => 'pages',
        'title' => __('Team Page Select Option', 'de'), 
        'subtitle' => __('Select Page', 'de'),
        'desc' => __('Create Team page and Select it for displaying in a about block template', 'de'),
    ),

    array(
        'id'=>'services-page',
        'type' => 'select',
        'data' => 'pages',
        'title' => __('Services Page Select Option', 'de'), 
        'subtitle' => __('Select Page', 'de'),
        'desc' => __('Create Services page and Select it for displaying in a about block template', 'de'),
    ),

    array(
        'id'=>'news-page',
        'type' => 'select',
        'data' => 'pages',
        'title' => __('News Page Select Option', 'de'), 
        'subtitle' => __('Select Page', 'de'),
        'desc' => __('Create News page and Select it for displaying in a about block template', 'de'),
    ),

)

);

$sections[] = array( 'icon' => 'website', 'icon_class' => 'icon-large', 'title' => ('Styling Options', 'de'), 'fields' => array( array( 'id'=>'stylesheet', 'type' => 'select', 'title' => ('Theme Stylesheet', 'de'), 'subtitle' => ('Select your themes alternative color scheme.', 'de'), 'options' => array('default.css'=>'default.css', 'color1.css'=>'color1.css'), 'default' => 'default.css', ), array( 'id'=>'color-background', 'type' => 'color', 'title' => ('Body Background Color', 'de'), 'subtitle' => ('Pick a background color for the theme (default: #fff).', 'de'), 'default' => '#FFFFFF', 'validate' => 'color', ), array( 'id'=>'color-footer', 'type' => 'color', 'title' => ('Footer Background Color', 'de'), 'subtitle' => ('Pick a background color for the footer (default: #dd9933).', 'de'), 'default' => '#dd9933', 'validate' => 'color', ), array( 'id'=>'color-header', 'type' => 'color_gradient', 'title' => ('Header Gradient Color Option', 'de'), 'subtitle' => ('Only color validation can be done on this field type', 'de'), 'desc' => __('This is the description field, again good for additional info.', 'de'), 'default' => array('from' => '#1e73be', 'to' => '#00897e') ), array( 'id'=>'link-color', 'type' => 'link_color', 'title' => ('Links Color Option', 'de'), 'subtitle' => ('Only color validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'default' => array( 'show_regular' => true, 'show_hover' => true, 'show_active' => true ) ), array( 'id'=>'header-border', 'type' => 'border', 'title' => ('Header Border Option', 'de'), 'subtitle' => ('Only color validation can be done on this field type', 'de'), 'output' => array('.site-header'), // An array of CSS selectors to apply this font style to 'desc' => ('This is the description field, again good for additional info.', 'de'), 'default' => array('border-color' => '#1e73be', 'border-style' => 'solid', 'border-top'=>'3px', 'border-right'=>'3px', 'border-bottom'=>'3px', 'border-left'=>'3px') ),
array( 'id'=>'spacing', 'type' => 'spacing', 'output' => array('.site-header'), // An array of CSS selectors to apply this font style to 'mode'=>'margin', // absolute, padding, margin, defaults to padding //'units' => 'em', // You can specify a unit value. Possible: px, em, % //'units_extended' => 'true', // Allow users to select any type of unit 'title' => ('Padding/Margin Option', 'de'), 'subtitle' => ('Allow your users to choose the spacing or margin they want.', 'de'), 'desc' => __('You can enable or disable any piece of this field. Top, Right, Bottom, Left, or Units.', 'de'), 'default' => array('margin-top' => '1px', 'margin-right'=>"2px", 'margin-bottom' => '3px', 'margin-left'=>'4px' ) ),
array( 'id'=>'dimensions', 'type' => 'dimensions', //'units' => 'em', // You can specify a unit value. Possible: px, em, % //'units_extended' => 'true', // Allow users to select any type of unit 'title' =>
('Dimensions (Width/Height) Option', 'de'), 'subtitle' => ('Allow your users to choose width, height, and/or unit.', 'de'), 'desc' => ('You can enable or disable any piece of this field. Width, Height, or Units.', 'de'), 'default' => array('width' => 200, 'height'=>'100', ) ),
array( 'id'=>'body-font2', 'type' => 'typography', 'title' => ('Body Font', 'de'), 'subtitle' => ('Specify the body font properties.', 'de'), 'google'=>true, 'default' => array( 'color'=>'#dd9933', 'font-size'=>'30px', 'font-family'=>'Arial, Helvetica, sans-serif', 'font-weight'=>'Normal', ), ),
array( 'id'=>'custom-css', 'type' => 'textarea', 'title' => ('Custom CSS', 'de'), 'subtitle' => ('Quickly add some CSS to your theme by adding it to this block.', 'de'), 'desc' => __('This field is even CSS validated!', 'de'), 'validate' => 'css', ), ) );

$sections[] = array( 'icon' => 'bullhorn', 'icon_class' => 'icon-large', 'title' => ('Field Validation', 'de'), 'desc' => ('

This is the Description. Again HTML is allowed2

', 'de'), 'fields' => array( array( 'id'=>'2', 'type' => 'text', 'title' => ('Text Option - Email Validated', 'de'), 'subtitle' => ('This is a little space under the Field Title in the Options table, additional info is good in here.', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'validate' => 'email', 'msg' => 'custom error message', 'default' => 'test@test.com' ),
array( 'id'=>'multi_text', 'type' => 'multi_text', 'title' =>
('Multi Text Option', 'de'), 'subtitle' => ('This is a little space under the Field Title in the Options table, additional info is good in here.', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de') ), array( 'id'=>'3', 'type' => 'text', 'title' => ('Text Option - URL Validated', 'de'), 'subtitle' => ('This must be a URL.', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'validate' => 'url', 'default' => 'http://reduxframework.com' ), array( 'id'=>'4', 'type' => 'text', 'title' => ('Text Option - Numeric Validated', 'de'), 'subtitle' => ('This must be numeric.', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'validate' => 'numeric', 'default' => '0', 'class' => 'small-text' ), array( 'id'=>'comma_numeric', 'type' => 'text', 'title' => ('Text Option - Comma Numeric Validated', 'de'), 'subtitle' => ('This must be a comma separated string of numerical values.', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'validate' => 'comma_numeric', 'default' => '0', 'class' => 'small-text' ), array( 'id'=>'no_special_chars', 'type' => 'text', 'title' => ('Text Option - No Special Chars Validated', 'de'), 'subtitle' => ('This must be a alpha numeric only.', 'de'), 'desc' => __('This is the description field, again good for additional info.', 'de'), 'validate' => 'no_special_chars', 'default' => '0' ), array( 'id'=>'str_replace', 'type' => 'text', 'title' => ('Text Option - Str Replace Validated', 'de'), 'subtitle' => ('You decide.', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'validate' => 'str_replace', 'str' => array('search' => ' ', 'replacement' => 'thisisaspace'), 'default' => '0' ), array( 'id'=>'preg_replace', 'type' => 'text', 'title' => ('Text Option - Preg Replace Validated', 'de'), 'subtitle' => ('You decide.', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'validate' => 'pregreplace', 'preg' => array('pattern' => '/[^a-zA-Z -]/s', 'replacement' => 'no numbers'), 'default' => '0' ), array( 'id'=>'custom_validate', 'type' => 'text', 'title' => ('Text Option - Custom Callback Validated', 'de'), 'subtitle' => ('You decide.', 'de'), 'desc' => __('This is the description field, again good for additional info.', 'de'), 'validate_callback' => 'validate_callback_function', 'default' => '0' ), array( 'id'=>'5', 'type' => 'textarea', 'title' => ('Textarea Option - No HTML Validated', 'de'), 'subtitle' => ('All HTML will be stripped', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'validate' => 'no_html', 'default' => 'No HTML is allowed in here.' ), array( 'id'=>'6', 'type' => 'textarea', 'title' => ('Textarea Option - HTML Validated', 'de'), 'subtitle' => ('HTML Allowed (wp_kses)', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'validate' => 'html', //see http://codex.wordpress.org/Function_Reference/wp_kses_post 'default' => 'HTML is allowed in here.' ), array( 'id'=>'7', 'type' => 'textarea', 'title' => ('Textarea Option - HTML Validated Custom', 'de'), 'subtitle' => ('Custom HTML Allowed (wp_kses)', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'validate' => 'html_custom', 'default' => '

Some HTML is allowed in here.

', 'allowed_html' => array('') //see http://codex.wordpress.org/Function_Reference/wp_kses ), array( 'id'=>'8', 'type' => 'textarea', 'title' => ('Textarea Option - JS Validated', 'de'), 'subtitle' => ('JS will be escaped', 'de'), 'desc' => __('This is the description field, again good for additional info.', 'de'), 'validate' => 'js' ),

    )
);

$sections[] = array( 'icon' => 'check', 'icon_class' => 'icon-large', 'title' => ('Radio/Checkbox Fields', 'de'), 'desc' => ('

This is the Description. Again HTML is allowed

', 'de'), 'fields' => array( array( 'id'=>'10', 'type' => 'checkbox', 'title' => ('Checkbox Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'default' => '1'// 1 = on | 0 = off ), array( 'id'=>'11', 'type' => 'checkbox', 'title' => ('Multi Checkbox Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'options' => array('1' => 'Opt 1','2' => 'Opt 2','3' => 'Opt 3'),//Must provide key => value pairs for multi checkbox options 'default' => array('1' => '1', '2' => '0', '3' => '0')//See how std has changed? you also don't need to specify opts that are 0. ), array( 'id'=>'checkbox-data', 'type' => 'checkbox', 'title' => ('Multi Checkbox Option (with menu data)', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'data' => "menu" ),
array( 'id'=>'12', 'type' => 'radio', 'title' =>
('Radio Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'options' => array('1' => 'Opt 1', '2' => 'Opt 2', '3' => 'Opt 3'),//Must provide key => value pairs for radio options 'default' => '2' ), array( 'id'=>'radio-data', 'type' => 'radio', 'title' => ('Multi Checkbox Option (with menu data)', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'data' => "menu" ),
array( 'id'=>'13', 'type' => 'image_select', 'title' => ('Images Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'options' => array( '1' => array('title' => 'Opt 1', 'img' => 'images/align-none.png'), '2' => array('title' => 'Opt 2', 'img' => 'images/align-left.png'), '3' => array('title' => 'Opt 3', 'img' => 'images/align-center.png'), '4' => array('title' => 'Opt 4', 'img' => 'images/align-right.png') ),//Must provide key => value(array:title|img) pairs for radio options 'default' => '2' ), array( 'id'=>'image_select', 'type' => 'image_select', 'title' => ('Images Option for Layout', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This uses some of the built in images, you can use them for layout options.', 'de'), 'options' => array( '1' => array('alt' => '1 Column', 'img' => ReduxFramework::$_url.'assets/img/1col.png'), '2' => array('alt' => '2 Column Left', 'img' => ReduxFramework::$_url.'assets/img/2cl.png'), '3' => array('alt' => '2 Column Right', 'img' => ReduxFramework::$_url.'assets/img/2cr.png'), '4' => array('alt' => '3 Column Middle', 'img' => ReduxFramework::$_url.'assets/img/3cm.png'), '5' => array('alt' => '3 Column Left', 'img' => ReduxFramework::$_url.'assets/img/3cl.png'), '6' => array('alt' => '3 Column Right', 'img' => ReduxFramework::$_url.'assets/img/3cr.png') ),//Must provide key => value(array:title|img) pairs for radio options 'default' => '2' ), array( 'id' => 'text_sortable', 'type' => 'sortable', 'title' =>
('Sortable Text Option', 'de'), 'sub_desc' => ('Define and reorder these however you want.', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'options' => array( 'si1' => 'Item 1', 'si2' => 'Item 2', 'si3' => 'Item 3', ) ),
array( 'id' => 'check_sortable', 'type' => 'sortable', 'mode' => 'checkbox', // checkbox or text 'title' => ('Sortable Text Option', 'de'), 'sub_desc' => ('Define and reorder these however you want.', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'options' => array( 'si1' => 'Item 1', 'si2' => 'Item 2', 'si3' => 'Item 3', ) ),
) ); $sections[] = array( 'icon' => 'list-alt', 'icon_class' => 'icon-large', 'title' =>
('Select Fields', 'de'), 'desc' => ('

This is the Description. Again HTML is allowed

', 'de'), 'fields' => array( array( 'id'=>'select', 'type' => 'select', 'title' =>
('Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'options' => array('1' => 'Opt 1','2' => 'Opt 2','3' => 'Opt 3'),//Must provide key => value pairs for select options 'default' => '2' ), array( 'id'=>'15', 'type' => 'select', 'multi' => true, 'title' => ('Multi Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), 'options' => array('1' => 'Opt 1','2' => 'Opt 2','3' => 'Opt 3'),//Must provide key => value pairs for radio options 'required' => array('select','equals',array('1','3')),
'default' => array('2','3') ), array( 'id'=>'multi-info', 'type' => 'info', 'desc' =>
('You can easily add a variety of data from WordPress.', 'de'), ), array( 'id'=>'select-categories', 'type' => 'select', 'data' => 'categories', 'title' => ('Categories Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ), array( 'id'=>'select-categories-multi', 'type' => 'select', 'data' => 'categories', 'multi' => true, 'title' => ('Categories Multi Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ), array( 'id'=>'select-pages', 'type' => 'select', 'data' => 'pages', 'title' => ('Pages Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ), array( 'id'=>'pages-multi_select', 'type' => 'select', 'data' => 'pages', 'multi' => true, 'title' => ('Pages Multi Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ),
array( 'id'=>'select-tags', 'type' => 'select', 'data' => 'tags', 'title' =>
('Tags Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ), array( 'id'=>'tags-multi_select', 'type' => 'select', 'data' => 'tags', 'multi' => true, 'title' =>
('Tags Multi Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ),
array( 'id'=>'select-menus', 'type' => 'select', 'data' => 'menus', 'title' => ('Menus Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ), array( 'id'=>'menus-multi_select', 'type' => 'select', 'data' => 'menu', 'multi' => true, 'title' => ('Menus Multi Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => __('This is the description field, again good for additional info.', 'de'), ),
array( 'id'=>'select-post-type', 'type' => 'select', 'data' => 'post_type', 'title' =>
('Post Type Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ), array( 'id'=>'post-type-multi_select', 'type' => 'select', 'data' => 'post_type', 'multi' => true, 'title' => ('Post Type Multi Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ),
array( 'id'=>'select-posts', 'type' => 'select', 'data' => 'post', 'title' =>
('Posts Select Option2', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ), array( 'id'=>'select-posts-multi', 'type' => 'select', 'data' => 'post', 'multi' => true, 'title' => ('Posts Multi Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ), array( 'id'=>'select-roles', 'type' => 'select', 'data' => 'roles', 'title' => ('User Role Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ), array( 'id'=>'select-capabilities', 'type' => 'select', 'data' => 'capabilities', 'multi' => true, 'title' => ('Capabilities Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('This is the description field, again good for additional info.', 'de'), ), array( 'id'=>'select-elusive', 'type' => 'select', 'data' => 'elusive-icons', 'title' => ('Elusive Icons Select Option', 'de'), 'subtitle' => ('No validation can be done on this field type', 'de'), 'desc' => ('Here\'s a list of all the elusive icons by name and icon.', 'de'), ),
) );

if (function_exists('wp_get_theme')){ $theme_data = wp_get_theme(); $theme_uri = $theme_data->get('ThemeURI'); $description = $theme_data->get('Description'); $author = $theme_data->get('Author'); $version = $theme_data->get('Version'); $tags = $theme_data->get('Tags'); }else{ $theme_data = wp_get_theme(trailingslashit(get_stylesheet_directory()).'style.css'); $theme_uri = $theme_data['URI']; $description = $theme_data['Description']; $author = $theme_data['Author']; $version = $theme_data['Version']; $tags = $theme_data['Tags']; }

$theme_info = '

'; $theme_info .= '

'.('Theme URL: ', 'de').''.$theme_uri.'

'; $theme_info .= '

'.('Author: ', 'de').$author.'

'; $theme_info .= '

'.('Version: ', 'de').$version.'

'; $theme_info .= '

'.$description.'

'; if ( !empty( $tags ) ) { $theme_info .= '

'.('Tags: ', 'de').implode(', ', $tags).'

'; } $theme_info .= '
';

if(file_exists(dirname(FILE).'/README.md')){ $tabs['theme_docs'] = array( 'icon' => ReduxFramework::$_url.'assets/img/glyphicons/glyphicons_071_book.png', 'title' => __('Documentation', 'de'), 'content' => file_get_contents(dirname(FILE).'/README.md') ); }//if

// You can append a new section at any time. $sections[] = array( 'icon' => 'eye-open', 'icon_class' => 'icon-large', 'title' => ('Additional Fields', 'de'), 'desc' => ('

This is the Description. Again HTML is allowed

', 'de'), 'fields' => array(

    array(
        'id'=>'17',
        'type' => 'date',
        'title' => __('Date Option', 'de'), 
        'subtitle' => __('No validation can be done on this field type', 'de'),
        'desc' => __('This is the description field, again good for additional info.', 'de')
        ),
    array(
        'id'=>'21',
        'type' => 'divide'
        ),                  
    array(
        'id'=>'18',
        'type' => 'button_set',
        'title' => __('Button Set Option', 'de'), 
        'subtitle' => __('No validation can be done on this field type', 'de'),
        'desc' => __('This is the description field, again good for additional info.', 'de'),
        'options' => array('1' => 'Opt 1','2' => 'Opt 2','3' => 'Opt 3'),//Must provide key => value pairs for radio options
        'default' => '2'
        ),
    array(
        'id'=>'23',
        'type' => 'info',
        'required' => array('18','equals',array('1','2')),  
        'desc' => __('This is the info field, if you want to break sections up.', 'de')
    ),
    array(
        'id'=>'info_warning',
        'type'=>'info',
        'style'=>'warning',
        'header'=> __( 'This is a header.', 'de' ),
        'desc' => __( 'This is an info field with the warning style applied and a header.', 'de')
    ),
    array(
        'id'=>'info_success',
        'type'=>'info',
        'style'=>'success',
        'icon'=>'info-sign',
        'header'=> __( 'This is a header.', 'de' ),
        'desc' => __( 'This is an info field with the success style applied, a header and an icon.', 'de')
    ),
    array(
        'id'=>'raw_info',
        'type' => 'info',
        'required' => array('18','equals',array('1','2')),
        'raw_html'=>true,
        'desc' => $sampleHTML,
        ),                          
    array(
        'id'=>"custom_callback",
        //'type' => 'nothing',//doesn't need to be called for callback fields
        'title' => __('Custom Field Callback', 'de'), 
        'subtitle' => __('This is a completely unique field type', 'de'),
        'desc' => __('This is created with a callback function, so anything goes in this field. Make sure to define the function though.', 'de'),
        'callback' => 'my_custom_field'
        ),

    array(
        'id'=>"group",
        'type' => 'group',//doesn't need to be called for callback fields
        'title' => __('Group', 'de'), 
        'subtitle' => __('Group any items together.', 'de'),
        'desc' => __('No limit as to what you can group. Just don\'t try to group a group.', 'de'),
        'groupname' => __('Group', 'de'), // Group name
        'subfields' => 
            array(
                array(
                    'id'=>'switch-fold',
                    'type' => 'switch', 
                    'title' => __('testing fold with Group', 'de'),
                    'subtitle'=> __('Look, it\'s on!', 'de'),
                    "default"       => 1,
                    ),  
                array(
                    'id'=>'text-group',
                    'type' => 'text',
                    'title' => __('Text', 'de'), 
                    'subtitle' => __('Here you put your subtitle', 'de'),
                    'required' => array('switch-fold', '=' , '1'),
                    ),
                array(
                    'id'=>'select-group',
                    'type' => 'select',
                    'title' => __('Testing select', 'de'), 
                    'subtitle' => __('Select your themes alternative color scheme.', 'de'),
                    'options' => array('default.css'=>'default.css', 'color1.css'=>'color1.css'),
                    'default' => 'default.css',
                    ),
                ),
        ),          

    )

);    

$tabs['item_info'] = array( 'icon' => 'info-sign', 'icon_class' => 'icon-large', 'title' => __('Theme Information', 'de'), 'content' => $item_info );

if(file_exists(trailingslashit(dirname(FILE)) . 'README.html')) { $tabs['docs'] = array( 'icon' => 'book', 'icon_class' => 'icon-large', 'title' => ('Documentation', 'de'), 'content' => nl2br(file_get_contents(trailingslashit(dirname(__FILE)) . 'README.html')) ); }

global $ReduxFramework; $ReduxFramework = new ReduxFramework($sections, $args, $tabs);

// END Sample Config

/**

Custom function for filtering the sections array. Good for child themes to override or add to the sections.
Simply include this function in the child themes functions.php file.

NOTE: the defined constants for URLs, and directories will NOT be available at this point in a child theme,
so you must use get_template_directory_uri() if you want to use any of the built in icons

**/ function add_another_section($sections){ //$sections = array(); $sections[] = array( 'title' => ('A Section added by hook', 'de'), 'desc' => ('

This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.

', 'de'), 'icon' => 'paper-clip', 'icon_class' => 'icon-large', // Leave this as a blank section, no options just some intro text set above. 'fields' => array() );

return $sections;

} add_filter('redux-opts-sections-redux-sample', 'add_another_section');

/**

Custom function for filtering the args array given by a theme, good for child themes to override or add to the args array.

**/ function change_framework_args($args){ //$args['dev_mode'] = false;

return $args;

} //add_filter('redux-opts-args-redux-sample-file', 'change_framework_args');

/\

Custom function for the callback referenced above

*/ function my_custom_field($field, $value) { print_r($field); print_r($value); }

/**

Custom function for the callback validation referenced above

*_/ function validate_callback_function($field, $value, $existingvalue) { $error = false; $value = 'just testing'; / do your validation

if(something) {
    $value = $value;
} elseif(something else) {
    $error = true;
    $value = $existing_value;
    $field['msg'] = 'your custom error message';
}
*/

$return['value'] = $value;
if($error == true) {
    $return['error'] = $field;
}
return $return;

}

/**

This is a test function that will let you see when the compiler hook occurs. 
It only runs if a field set with compiler=>true is changed.

**/ function testCompiler() { //echo "Compiler hook!"; } add_action('redux-compiler-redux-sample-file', 'testCompiler');

/**

Use this code to hide the activation notice telling users about a sample panel.

**/ if ( class_exists('ReduxFrameworkPlugin') ) { //remove_action('admin_notices', array( ReduxFrameworkPlugin::get_instance(), 'admin_notices' ) );
}

/**

Use this code to hide the demo mode link from the plugin page. Only used when Redux is a plugin.

**/ function removeDemoModeLink() { if ( class_exists('ReduxFrameworkPlugin') ) { remove_filter( 'plugin_row_meta', array( ReduxFrameworkPlugin::get_instance(), 'plugin_meta_demo_mode_link'), null, 2 ); } } //add_action('init', 'removeDemoModeLink');

ghost commented 10 years ago

That is my config.php i couldnt send you the .php file itself. Under the general settings first field is sorter. Thx

dovy commented 10 years ago

So now, what are you trying to do with it?

P.S. Please use gist.github.com so I can see the code as you have it.

kprovance commented 10 years ago

Try taking out the 'required' => array('switch-fold','equals','0'), line. That sorter won't show unless the switch it's hooked into is set to false (0).

It's also probably a good idea, when setting up your own options, to use the sample as a guide, and not a cut-and-paste model. If you don't understand what the code is doing, it's not going to be very useful to you. :)

ghost commented 10 years ago

Sorry dovy for pasting big code, I am new here. Kprovance thank you very much for your help ! It works! I just stared using Redux and Its new for me but Am a fast learner. Just one more thing. How does this sort field work ? How to get it work with my pages or blocks ? Cuz I see there are

ghost commented 10 years ago

"enabled" => array( "placebo" => "placebo", //REQUIRED! "highlights" => "Highlights", "slider" => "Slider", "staticpage" => "Static Page", "services" => "Services" ), "disabled" => array( "placebo" => "placebo", //REQUIRED! )

These fields. How can I embed my page or block from .php file if you understand me.

dovy commented 10 years ago

The sorter only provides you an array of values. You must produce the code that does the rest. If you don't understand how, I'd suggest you look at some wordpress.org tutorials.

P.S. Thank you for coming the community! We hope you enjoy Redux. Where did you come from BTW?

ghost commented 10 years ago

Can you give me some specific link for this ? I worked with SMOF and know how those are working is it the same way or ? ITs realy nice to join you especially cuz Am a young student from Croatia and I work as a web designer and wordpress theme developer. Redux is a one stair up for me !

dovy commented 10 years ago

Sorry, did I finish answering your questions? I want to make sure you're taken care of.

dovy commented 10 years ago

BTW, you may want to use this: https://github.com/ReduxFramework/ReduxFramework/wiki/SMOF2Redux

It will get you over here really quick.

dovy commented 10 years ago

@Sempachoo You may want to see this: https://github.com/ReduxFramework/redux-converter