support for independent file name and template override

This commit is contained in:
Andy Miller
2015-08-29 10:43:58 -06:00
parent c8fcda0372
commit e2e1076e8e
4 changed files with 7 additions and 5 deletions

View File

@@ -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));

View File

@@ -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;

View File

@@ -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...

View File

@@ -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 %}