Feature custom page options (#1104)

* Add slug util function

* Add custom add modals support
This commit is contained in:
Dávid Szabó
2017-05-16 17:31:57 +02:00
committed by Flavio Copes
parent c30accdea4
commit bc011c25c3
3 changed files with 45 additions and 1 deletions

View File

@@ -655,7 +655,12 @@ class AdminController extends AdminBaseController
}
$route = $data['route'] != '/' ? $data['route'] : '';
$folder = ltrim($data['folder'], '_');
$folder = $data['folder'];
// Handle @slugify-{field} value, automatically slugifies the specified field
if (substr($folder, 0, 9) == '@slugify-') {
$folder = \Grav\Plugin\Admin\Utils::slug($data[substr($folder, 9)]);
}
$folder = ltrim($folder, '_');
if (!empty($data['modular'])) {
$folder = '_' . $folder;
}