We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Ok, let's try this again.

    I need to have a custom combo box for a system setting. There are a number of these widgets defined in manager/assets/modext/widgets/core/modx.combo.js. They are mostly extensions of the initial modx-combo widget.

    These widgets get loaded up with the relevant data for display in the system settings.

    For example, if I do something like this
    $MySetting = $modx->newObject('modSystemSetting');
    $MySetting->set('key', 'markitup.set');
    $MySetting->set('value', 'set1');
    $MySetting->set('xtype', 'modx-combo-rte');
    $MySetting->set('namespace', 'markitup');
    $MySetting->set('area', 'Rich-Text Editor');
     
    $MySetting->save();
     
    // Clear the cache:
    $cacheRefreshOptions =  array( 'system_settings' => array() );
    $modx->cacheManager-> refresh($cacheRefreshOptions);

    I'll get a drop-down with the first option of "set1", then with all the RTEs that I have installed.

    The question is, how can I create a custom combo box for my own package's settings? Can I just create one in my build somewhere, using the basic modx-combo as the core?
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org