Wishlist of future CB input-types

Hi, I just want to log some ideas for possible CB input-types.

  • Image+ Cropping
  • MIGX-TV as input type

To be continued…

1 Like

A better table input that has the ability to add thead (like the one that comes with redactor. this is essential if you want to add any dynamic table sorting.

more ideas to come!

2 Likes

Yes, a Cropping tool with predefined image ratios would be a great addon.
Or maybe something like a responsive image where you can select a part of the image for each defined breakpoint.

i’d also like to see a horizontal repeater, that can be used for sliders and other horizontal elements. then the backend could reflect the frontend a bit more.

Also a Google Maps Input Type could be a plus.

A Resource Select input, i already wrote one as extra for CB but i’d like to see something like this in the core of CB.

1 Like

A field that supports web video (mp4, ogv, webm) which would be handy for setting up video backgrounds. at the moment, i’m using a textfield with the path to the video files.

2 Likes

Image cropper is in the works.

1 Like

A simple type for adding instructions for the editor (without any input field) would be nice. There should be room for more than a short sentence.

1 Like

A “TV”-Field-Type, which loads any given TV :slight_smile:

2 Likes

Hi @jonleverrier, I know a little bit late, but just wanted to share with you my solution to Web-Video files on an element. My “Hero-Video” has multiple video settings, for Desktop/Mobile and their respective formats, which are dropdowns:

image

The options are a processed snippet-call, which filters on the relevant extension:

[[GetMediaFilesOptions? 
    &extensions=`webm`
]]

The snippet looks like this:

<?php
/**
 * GetMediaFilesOptions
 *
 * Copyright 2021 by Sebastian G. Marinescu <info@sebastian-marinescu.com>
 * Website is a proprietary package. All rights reserved.
 *
 * @author    Sebastian G. Marinescu
 * @copyright Sebastian G. Marinescu
 * @package   website
 *
 */
 
$output = 'No files';
$root = (string) $modx->getOption('root', $scriptProperties, null, 'media/');
$delimited = (boolean) $modx->getOption('delimited', $scriptProperties, false, true);
$extensions = (string) $modx->getOption('extensions', $scriptProperties, null);

$path = $modx->getOption('base_path').$root;
if (substr($path,-1,1) != '/') { $path .= '/'; }
if (!is_dir($path)) { return $output; }

$iter = new RecursiveIteratorIterator(
    new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),
    RecursiveIteratorIterator::SELF_FIRST,
    RecursiveIteratorIterator::CATCH_GET_CHILD // Ignore "Permission denied"
);

$paths = array();
foreach ($iter as $path => $file) {
    if (!$file->isReadable()) continue;
    if ($file->isDir()) continue;

    $basename = $file->getFilename();
    if ($basename == '.gitkeep') continue;
    
    if (!empty($extensions)) {
        $filetypes = explode(',', trim(str_replace(' ', '', $extensions)));
        $filetype = pathinfo($file, PATHINFO_EXTENSION);
        if (!in_array(strtolower($filetype), $filetypes)) {
            continue;
        }
    }
    
    $file = str_replace($modx->getOption('base_path'), '', $file);
    $paths[] = "{$file}";
}

asort($paths);

if ($delimited) {
    array_unshift($paths, "Keine Auswahl==");
    $output = implode("||", $paths);
} else {
    array_unshift($paths, "Keine Auswahl=");
    $output = implode("\n", $paths);
}

return $output;

Then your editors won’t have to type in a path, but can just select the video:

image

Have fun!

1 Like