I have a template with a slideshow in it. Each slide consists of:
For the first
I have the same Problem like Panagiotis Koursaris. I used the template variables without a repeater. I fixed the problem by specifying the options and adding an alias in Plugin boot method. e.g.:
{variable name="type" type="dropdown" options="StaticPage | getTypeOptions" label="Link Type" tab="Text Image Header (dark)"}{/variable}
\Illuminate\Foundation\AliasLoader::getInstance()->alias('StaticPage','RainLab\\Pages\\Classes\\Page');
But the trigger don't work, all dropdowns were displayed. Any idea to fix it?
The next problem is, that all cms pages are displayed as follows:
projects [projects]
I change the code in the second loop as follows:
if ($type == 'cms-page') {
$cmsPages = [];
if (!is_array($value)) {
continue;
}
foreach ($value as $url => $pageArray) {
$page = \Cms\Classes\Page::find($url);
if ($page) {
$baseName = $page->getBaseFileName();
$pos = strrpos($baseName, '/');
$dir = $pos !== false ? substr($baseName, 0, $pos) . ' / ' : null;
$cmsPages[$baseName] = strlen($page->title) ? $dir . $page->title : $baseName;
}
}
$value = $cmsPages;
}