Installation

This is a user-contributed Extra. If you find issues or would like more info or help, please contact the author.

There are two possibilities to install multiTV in Evo

  1. Use the Evo Package Manager and install the latest multiTV package.

  2. Install it on your own:

    • Upload the folder "assets/tvs/multitv" in the corresponding folder in your installation.

    • Create a new template variable with input type "custom input" (if you name this template variable multidemo it will use the already uploaded multidemo config file)

    • Insert the following code into the input option values

      @INCLUDE/assets/tvs/multitv/multitv.customtv.php
    • Create a new snippet called multiTV with the following snippet code

      <?php return include(MODX_BASE_PATH.'assets/tvs/multitv/multitv.snippet.php'); ?>

Compatibility patches

  1. If you want to modify the multiTV with ManagerManager before Evo version 1.0.9 you have to patch the file mm.inc.php and insert case 'custom_tv': in line 136 just before the line $t = 'textarea';

  2. If you want to use multiTV with YAMS you have to patch "yams.plugin.inc.php" according to the following instructions:

    Preventing YAMS from parsing documents when in manager mode. To do this you have to open the file "assets/modules/yams/yams.plugin.inc.php" and change the lines "181" to "204" from:

    case 'OnParseDocument':
      // error_log('OnParseDocument');
      $docId = $modx->documentObject['id'];
      $template = $modx->documentObject['template'];
     $isMultilingualDocument =
      $yams->IsMultilingualDocument(
      $docId
      //      , $template
      );
     $yams->InitialiseParser( $isMultilingualDocument );
     do {
      $finished = $yams->PreParse(
      $modx->documentOutput
      , $docId
      , $template
      , $isMultilingualDocument
      );
      } while ( ! $finished );
    
    break;

    to

    case 'OnParseDocument':
    if (IN_MANAGER_MODE != 'true') {
    // error_log('OnParseDocument');
    $docId = $modx->documentObject['id'];
    $template = $modx->documentObject['template'];
     $isMultilingualDocument =
      $yams->IsMultilingualDocument(
      $docId
      //      , $template
      );
     $yams->InitialiseParser( $isMultilingualDocument );
     do {
      $finished = $yams->PreParse(
      $modx->documentOutput
      , $docId
      , $template
      , $isMultilingualDocument
      );
      } while ( ! $finished );
    
     }
    break;

    This tells the yams plugin to check if it's not in manager before parsing the document.

  3. If you are updating from 1.4.10 and below you could install the updateTV snippet and modify the data in your multiTVs to the new format. Since the custom tv and the snippet code supports the old and new format, this is only necessary, if you want to add / remove columns in your multiTVs or if you want to sort the output by a column.

  4. If you want to use PHx with multiTV you have to modify the PHx plugin code a bit:

    if (!class_exists('PHxParser')) {
        include MODX_BASE_PATH . "assets/plugins/phx/phx.parser.class.inc.php";
    }
    $e = &$modx->Event;
    switch($e->name) {
        case 'OnParseDocument':
            $PHx = new PHxParser($phxdebug,$phxmaxpass);
            $PHx->OnParseDocument();
            break;
    }
  5. ManagerManager expects a custom tv field to be an input tag. Because of single and double quote issues the field containing the multiTV value is a textarea.

Suggest an edit to this page.