mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-06 04:37:08 +02:00
support for independent file name and template override
This commit is contained in:
@@ -583,11 +583,11 @@ class Admin
|
||||
|
||||
}
|
||||
|
||||
if ($data['type'] == 'modular') {
|
||||
if ($data['name'] == 'modular') {
|
||||
$header['body_classes'] = 'modular';
|
||||
}
|
||||
|
||||
$name = $page->modular() ? str_replace('modular/', '', $data['type']) : $data['type'];
|
||||
$name = $page->modular() ? str_replace('modular/', '', $data['name']) : $data['name'];
|
||||
$page->name($name . '.md');
|
||||
$page->header($header);
|
||||
$page->frontmatter(Yaml::dump((array)$page->header(), 10, 2, false));
|
||||
|
||||
@@ -1300,8 +1300,8 @@ class AdminController
|
||||
$page->folder($ordering . $slug);
|
||||
}
|
||||
|
||||
if (isset($input['type']) && !empty($input['type'])) {
|
||||
$type = (string) strtolower($input['type']);
|
||||
if (isset($input['name']) && !empty($input['name'])) {
|
||||
$type = (string) strtolower($input['name']);
|
||||
$name = preg_replace('|.*/|', '', $type);
|
||||
if ($language) {
|
||||
$name .= '.' . $language;
|
||||
|
||||
@@ -426,6 +426,8 @@ en:
|
||||
FULLY_UPDATED: Fully Updated
|
||||
SAVE_LOCATION: Save location
|
||||
|
||||
PAGE_FILE: Page File
|
||||
PAGE_FILE_HELP: Page file name, and by default the display template for this page
|
||||
es:
|
||||
PLUGIN_ADMIN:
|
||||
ADMIN_BETA_MSG: ¡Está es una versión Beta! Utilízala bajo tu propio riesgo...
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% set preview_html = (base_url_relative_frontend|rtrim('/') ~ (context.home ? '' : context.route)) ?: '/' %}
|
||||
{% set preview_link = '<a class="preview" target="_blank" href="' ~ preview_html ~ '"><i class="fa fa-fw fa-angle-double-right"></i></a>' %}
|
||||
{% set preview_link = context.routable ? '<a class="preview" target="_blank" href="' ~ preview_html ~ '"><i class="fa fa-fw fa-angle-double-right"></i></a>' : '' %}
|
||||
|
||||
{% macro loop(page, depth, twig_vars) %}
|
||||
{% set separator = twig_vars['config'].system.param_sep %}
|
||||
|
||||
Reference in New Issue
Block a user