Media Selector

class Nos\Renderer_Media
This renderer is used to pick a file from the media centre.
Default UI:Default UI
Hover state UI:Hover state UI
Hover state with a selected media UI:
 Hover state with a selected media UI


property Nos\Renderer_Media::$mode

Possible values are image (default) or all.

property Nos\Renderer_Media::$inputFileThumb

Options for the inputFileThumb widget used to render the UI. See the inputFileThumb documentation for all available options.


The inputFileThumb.file key will automatically be populated with the URL of the media if a value is provided in the renderer.


  • $renderer (Model) – HTML attributes (name, class, id, value, etc.), with a special key renderer_options

The <input> tag with JavaScript to initialise it

Displays a media selector in a standalone manner.


Adding a media in a CRUD form configuration:


return array(
    'label' => '',
    'renderer' => 'Nos\Renderer_Media',
    'renderer_options' => array(
        'mode' => 'image',
            'inputFileThumb' => array(
            'title' => 'Title of the image',

Displaying a media selector:


echo Nos\Renderer_Media::renderer(array(
    'name' => 'my_image',
    'class' => 'some_class',
    'value' => 2, // ID of the previously selected media
    'renderer_options' => array(
        'mode' => 'image',
            'inputFileThumb' => array(
            'title' => 'Title of the image',