Is there a way to populate the options of a dropdown of a snippet in October CMS via the php code section of the htm file?
Please see the simplified example below (that does not work), to get an idea of what I want to accomplish.
[viewBag]
snippetCode = "overview"
snippetName = "Overview of pages"
snippetDescription = "Show an overview of the children of a specific page"
snippetProperties[parent][title] = "Parent page"
snippetProperties[parent][type] = "dropdown"
# A list of static pages should be loaded here
snippetProperties[parent][options] = ""
==
function onStart()
{
$this['parent'] = RainLab\Pages\Classes\Page::load(\Cms\Classes\Theme::getEditTheme(), $this['parent'].'.htm');
$this['children'] = $this['parent']->getChildren();
}
==
{% for child in children %}
{{ child.title }}
{% endfor %}