mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-06 20:16:52 +02:00
breakout codemirror field so it can be used directly (like raw)
Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
@@ -37,7 +37,7 @@ form:
|
||||
lint: true
|
||||
|
||||
content:
|
||||
type: markdown
|
||||
type: codemirror
|
||||
|
||||
header.media_order:
|
||||
type: pagemedia
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{% extends "forms/fields/editor/editor.html.twig" %}
|
||||
{% set theme = config.plugins.admin.whitelabel.codemirror_theme ?? 'paper.css' %}
|
||||
{% set font = config.plugins.admin.whitelabel.codemirror_md_font ?? 'sans' %}
|
||||
{% set codemirrorOptions = {'mode': 'gfm', 'theme': theme, 'font': font, 'ignore': []}|merge(field.codemirror|default({})) %}
|
||||
|
||||
{# backward compatibility #}
|
||||
{% if field.showPreview %}
|
||||
{% set codemirrorOptions = codemirrorOptions|merge({'ignore': []}) %}
|
||||
{% endif %}
|
||||
{# end backward compatibility #}
|
||||
@@ -1,12 +1 @@
|
||||
{# Deprecated field. Alias to editor/editor.html.twig #}
|
||||
|
||||
{% extends "forms/fields/editor/editor.html.twig" %}
|
||||
{% set theme = config.plugins.admin.whitelabel.codemirror_theme ?? 'paper.css' %}
|
||||
{% set font = config.plugins.admin.whitelabel.codemirror_md_font ?? 'sans' %}
|
||||
{% set codemirrorOptions = {'mode': 'gfm', 'theme': theme, 'font': font, 'ignore': []}|merge(field.codemirror|default({})) %}
|
||||
|
||||
{# backward compatibility #}
|
||||
{% if field.showPreview %}
|
||||
{% set codemirrorOptions = codemirrorOptions|merge({'ignore': []}) %}
|
||||
{% endif %}
|
||||
{# end backward compatibility #}
|
||||
{% extends "forms/fields/codemirror/codemirror.html.twig" %}
|
||||
|
||||
Reference in New Issue
Block a user