Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option set before tabs container display after #319

Closed
danyj opened this issue Mar 5, 2015 · 6 comments
Closed

Option set before tabs container display after #319

danyj opened this issue Mar 5, 2015 · 6 comments

Comments

@danyj
Copy link
Contributor

danyj commented Mar 5, 2015

Try this in theme options

            'aaaaa' => array(
                'type' => 'short-text',
                'value' => '300',
                'label' => __('AAAA', 'unyson'),
            ),          
            'layout' => array(
                'title'   => __( 'Layout', 'unyson' ),
                'type'    => 'tab',
                'options' => array(
                    //fw()->theme->get_options( 'layout' ),
                ),
            ),

The aaa option will be displayed after the tab instead before

http://prntscr.com/6d0g0n

@ghost
Copy link

ghost commented Mar 5, 2015

The fw()->backend->render_options() method works in this way:

  1. Collect first level tabs,boxes,groups,options

  2. Display all collected tabs

    <div class="fw-options-tabs-wrapper">
        <div class="fw-options-tabs-list">...tab1...tab2...tabX...</div>
        <div class="fw-options-tabs-contents">...tab1content...tab2content...tabXcontent...</div>
    </div>
  3. Display all collected boxes

    <div class="fw-backend-postboxes metabox-holder">...box1...box2...boxN...</div>
  4. Display all collected groups and options


I thought no one will want to display options outside tabs, that there will be only regular settings pages:

tab -> (box ->) option


This is critical for you or you just noticed that while experimenting with options?

@danyj
Copy link
Contributor Author

danyj commented Mar 5, 2015

Not critical but I wanted to add #318 before the sub tabs since I have nested tabs

Tab1(selected), Tab2, Tab3
Description (318 ) 
Sub tab1 , Sub tab2, Sub tab3

http://prntscr.com/6d0uas

@ghost
Copy link

ghost commented Mar 5, 2015

I will take a look and see if a can display tabs,boxes,groups,options exactly in the order they are in array.

@ghost ghost added the enhancement label Mar 5, 2015
@ghost ghost self-assigned this Mar 5, 2015
ghost pushed a commit that referenced this issue Mar 6, 2015
@ghost
Copy link

ghost commented Mar 6, 2015

Done

Please download the latest version of Unyson from Github and test with these options:

$options = array(
    'tab-1' => array(
        'title'   => __( 'Tab1', 'unyson' ),
        'type'    => 'tab',
        'options' => array(
            't1t' => array('type' => 'text'),
        ),
    ),
    'tab-2' => array(
        'title'   => __( 'Tab2', 'unyson' ),
        'type'    => 'tab',
        'options' => array(
            't2t' => array('type' => 'text'),
        ),
    ),
    'group-1' => array(
        'type'    => 'group',
        'options' => array(
            'g1t' => array('type' => 'text'),
        ),
    ),
    'text1' => array('type' => 'text'),
    'tab-3' => array(
        'title'   => __( 'Tab3', 'unyson' ),
        'type'    => 'tab',
        'options' => array(
            't3t' => array('type' => 'text'),
        ),
    ),
    'box-1' => array(
        'title'   => __( 'Box1', 'unyson' ),
        'type'    => 'box',
        'options' => array(
            'b1t' => array('type' => 'text'),
        ),
    ),
    'text2' => array('type' => 'text'),
    'tab-4' => array(
        'title'   => __( 'Tab4', 'unyson' ),
        'type'    => 'tab',
        'options' => array(
            't4t' => array('type' => 'text'),
        ),
    ),
    'tab-5' => array(
        'title'   => __( 'Tab5', 'unyson' ),
        'type'    => 'tab',
        'options' => array(
            't5t' => array('type' => 'text'),
        ),
    ),
    'group-2' => array(
        'type'    => 'group',
        'options' => array(
            'g2t' => array('type' => 'text'),
        ),
    ),
);

@danyj
Copy link
Contributor Author

danyj commented Mar 6, 2015

Thank you my friend. I just shutdown for the day. Will test and reply tomorow.

@danyj
Copy link
Contributor Author

danyj commented Mar 7, 2015

Excellent. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant