Blog Sections Open

Using `@SELECT` Dropdowns Inside MultiTV Configs in Evolution CMS

How to build a MultiTV dropdown from live resources with an `@SELECT` query in the config file.

MultiTV becomes much more useful when one of its fields can pull options from real site content instead of a hard-coded list. A common pattern is to define a dropdown field whose values come straight from site_content.

The original config looked like this:

$settings['fields'] = array(
    'dropdown' => array(
        'caption' => '',
        'type' => 'dropdown',
        'elements' => '@SELECT pagetitle, id FROM [+PREFIX+]site_content WHERE parent = 2 AND `published` = 1 ORDER BY menuindex ASC'
    )
);

This is a solid pattern because it lets editors work with a controlled list that updates automatically when the underlying resources change. It is especially useful for catalogs, internal links, landing-page selectors, and any repeatable data structure where a MultiTV row should reference another document.

If the dropdown does not behave correctly, check three things first: whether the query returns exactly the two columns the field expects, whether the selected parent really contains published resources, and whether the stored value should be an ID or a visible label.

Once that is clear, MultiTV stops being just a repeatable text field and starts acting like a structured relational input layer for Evolution CMS.

Newer post

Building Tag Links for `getResourcesTag` in Evolution CMS

A practical pattern for turning TV-based tags into links and using getResourcesTag to render filtered archive pages.

Older post

Generating PDF Versions of Evolution CMS Resources with TCPDF

A practical pattern for rendering an Evolution CMS resource as HTML or exporting the same content as a PDF through TCPDF.