Results 1 to 5 of 5

Thread: Palette switching

  1. #1
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Palette switching

    I'm stumped. Please can a developer look at my code to check it. I'm short of publishing a little CE_Wrapper extension, which makes start/stop wrappers a breeze (instead of using HTML elements). However when I click on the wrapType radio button to change it to "stop", it reloads and it doesn't do anything (e.g. the field list must change and it must remove "cssID" and "space" but it doesn't - it keeps the "wrapstart" palette. Hmm... I checked it against the mooType (backend) and also again another extension tabcontrol.

    Perhaps my words wrapstart and wrapend are reserved words or something?

    Code:
    /**
     * Table tl_content
     */
    $GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'wrapType';
    
    $GLOBALS['TL_DCA']['tl_content']['palettes']['wrap'] = '{type_legend},type,wrapType';
    $GLOBALS['TL_DCA']['tl_content']['palettes']['wrapstart'] = '{type_legend},type,wrapType;{protected_legend:hide},protected;{expert_legend:hide},guests,invisible,cssID,space';
    $GLOBALS['TL_DCA']['tl_content']['palettes']['wrapstop'] = '{type_legend},type,wrapType;{protected_legend:hide},protected;{expert_legend:hide},guests,invisible';
    
    
    // Fields
    $GLOBALS['TL_DCA']['tl_content']['fields']['wrapType'] = array
    (
    	'label'					=> &$GLOBALS['TL_LANG']['tl_content']['wrapType'],
    	'default'				=> 'start',
    	'exclude'				=> true,
    	'inputType'			=> 'radio',
    	'options'				=> array('start', 'stop'),
    	'reference'			=> &$GLOBALS['TL_LANG']['tl_content']['wrapTypes'],
    	'eval'					=> array('helpwizard'=>true, 'submitOnChange'=>true)
    );

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Palette switching

    AFAIK a selector operates a subpalette, but you don't have any subpalettes.

  3. #3
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Palette switching

    Nope it can also toggle a main palette. I figured it out. You cannot reuse field values. Moo accordion was already using start stop, so my values had to be unique. I used wrapstart and wrapend and it works.

  4. #4
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Palette switching

    Nope it can also toggle a main palette.
    Very good to know ta.

  5. #5
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Palette switching

    i used values of "wstart" and "wstop" which creates unique values for the combining function to test for the palette names wrapwstart and wrapwstop.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •