MODX Community

CheckboxSortable - Output

Hi.

I have a small problem with the plugin “CheckboxSortable”. At the output I always get || in HTML. The variable was created as described:

Type: Checkbox Sortable

Input:
Content==[[$content]]||
Banner==[[$headbanner]]||
Gallery==[[$gallery]]||
Contact==[[$contact box]]

When outputting, the chunks are output correctly and the || are always written behind them. Does anyone know the problem too?

CheckboxSortable Plugin:

<?php

/**

  • @var modX $modx
  • @var array $scriptProperties
    */
    $corePath = $modx->getOption(‘checkboxsortable.core_path’, null, $modx->getOption(‘core_path’) . ‘components/checkboxsortable/’);
    $assetsURL = $modx->getOption(‘checkboxsortable.assets_url’, null, $modx->getOption(‘assets_url’) . ‘components/checkboxsortable/’);
    $modx->lexicon->load(‘checkboxsortable:default’);
    $lexicons = $modx->lexicon->loadCache(‘checkboxsortable’, ‘default’);

switch ($modx->event->name) {

case 'OnDocFormPrerender':
case 'OnTVFormPrerender':
    $modx->controller->addHtml('<script type="text/javascript">
Ext.applyIf(MODx.lang, '. $modx->toJSON($lexicons) .');

');
//$modx->regClientStartupScript($assetsURL . ‘checkboxsortable.js’);
if (‘OnTVFormPrerender’ == $modx->event->name) {
// Load JS for input properties
$modx->regClientStartupScript($assetsURL . ‘checkboxsortable-properties.js’);
}
break;

case 'OnTVInputRenderList':
    $modx->event->output($corePath. 'elements/tv/input/');
    break;

case 'OnTVInputPropertiesList':
    $modx->event->output($corePath. 'elements/tv/properties/');
    break;

// case ‘OnTVOutputRenderList’:
// $modx->event->output($corePath. ‘elements/tv/output/’);
// break;
}
return;

In the settings for the template variable, you can probably change the ‘Output Options’. Change the ‘Output Type’ to Delimiter and leave the field ‘Delimiter’ empty.

1 Like

Thank you. That works!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.