From 5596cd7ec4c54d32919a55f2e2aaf4d4b116e66e Mon Sep 17 00:00:00 2001 From: Philipp Kitzberger Date: Mon, 16 May 2016 19:29:30 +0200 Subject: [PATCH 1/2] Added label and help text --- blueprints.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blueprints.yaml b/blueprints.yaml index d193e15..5d021f2 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -36,4 +36,6 @@ form: help: CSS Files that will be loaded on every page. Use relative or absolute URLs fields: .path: - type: text \ No newline at end of file + type: text + label: File path + help: Relative to web root From 818d3ddc7d5d67906ef5db789940a7146e1b71ab Mon Sep 17 00:00:00 2001 From: Philipp Kitzberger Date: Mon, 16 May 2016 19:30:15 +0200 Subject: [PATCH 2/2] Added field to manipulate priority --- blueprints.yaml | 5 +++++ custom-css.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/blueprints.yaml b/blueprints.yaml index 5d021f2..ef3b042 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -39,3 +39,8 @@ form: type: text label: File path help: Relative to web root + .priority: + type: int + label: Priority (0=Default) + help: Lower means later inclusion. Negative value to add this file after the other files (that come with the theme) + default: 0 diff --git a/custom-css.php b/custom-css.php index 6a8b127..f557c97 100644 --- a/custom-css.php +++ b/custom-css.php @@ -40,7 +40,7 @@ public function onAssetsInitialized() $this->grav['assets']->addInlineCss($this->config->get('plugins.custom-css.css_inline')); foreach($this->config->get('plugins.custom-css.css_files') as $file) { - $this->grav['assets']->addCss($file['path']); - } + $this->grav['assets']->addCss($file['path'], isset($file['priority']) ? $file['priority'] : null); + } } }