grav

Grav - Using shortcodes in twig

大憨熊 提交于 2019-12-24 23:15:54
问题 Following this question, I have found that there is a plugin named shortcodes which might be helpful here. I have installed the plugin and created a new page: --- title: slide1 media_order: slider1.jpeg taxonomy: category: - 'Home Slider' process: markdown: true twig: true routable: false cache_enable: false visible: false --- [section name="slide_title"] Precisión y Calidad [/section] [section name="slide_subtitle"] La máxima calidad y seguridad para nuestros clientes [/section] [section

Grav - Retrieving specific items from page in template

时光毁灭记忆、已成空白 提交于 2019-12-23 03:31:11
问题 I have the following page structure in Grav: # Title ## Subtitle ### Subsubtitle The page structure is always the same and it has just those three items. How can I retrieve each item (Title/Subtitle/Subsubtitle) separately in Twig template? The twig template will then do things like: <p> You typed {{ page.whatever_retrieves_the_title_# }} as title, then {{ page.whatever_retrieves_the_subtitle_## }} as subtitle and finally {{ page.whatever_retrieves_the_subsubtitle_### }} as subsubtitle</p>

“Illegal offset type in isset or empty” when using a Twig macro

那年仲夏 提交于 2019-12-13 03:17:13
问题 Using Grav v1.3.8 (running on PHP 5.6.30), I'm currently getting a Server error ( "Illegal offset type in isset or empty" ) when trying to render a Twig template that is using a macro. What's interesting is that this only happens when I use the macro by itself. As soon as I append a filter, like trim , everything works as expected. The (shortened) macro file, helpers.twig : {% macro ascii(str) %} {% spaceless %} {{ str|replace({ 'Á': 'A', 'À': 'A', 'Â': 'A', 'Ã': 'A', .... 'ƒ': 'f' }) }} {%

mod_security rule 981172 false positive

久未见 提交于 2019-12-11 20:12:26
问题 The mod_security configuration in Apache, on the CWP7.admin, generates a 403 access denied error when running Grav CMS: [Thu Mar 21 15:40:47.967502 2019] [:error] [pid 21727:tid 140715786946304] [client 186.67.206.59:57900] [client 186.67.206.59] ModSecurity: Access denied with code 403 (phase 2). Pattern match "([\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\+\\=\\{\\}\\[\\]\\|\\:\\;\"\\'\\\xc2\xb4\\\xe2\x80\x99\\\xe2\x80\x98\\`\\<\\>].*?){8,}" at REQUEST_COOKIES:grav-tabs-state. [file "/usr/local

GRAV subnavigation

[亡魂溺海] 提交于 2019-12-07 07:11:31
问题 I try to make my first site with GRAV CMS. Now in my pages-folder it looks like this: home/default.md about about/seite1/default.md about/seite2/default.md Now, if i put the following code into my html-file, only the main points are showed in the navigation. <nav class="" role="navigation"> <div class=""> <ol class=""> {% for page in pages.children %} {% if page.visible %} {% set current_page = (page.active or page.activeChild) ? 'active' : '' %} <li class="{{ current_page }}"><a href="{{

Grav - Retrieving specific items from page in template

一世执手 提交于 2019-12-06 17:36:26
I have the following page structure in Grav: # Title ## Subtitle ### Subsubtitle The page structure is always the same and it has just those three items. How can I retrieve each item (Title/Subtitle/Subsubtitle) separately in Twig template? The twig template will then do things like: <p> You typed {{ page.whatever_retrieves_the_title_# }} as title, then {{ page.whatever_retrieves_the_subtitle_## }} as subtitle and finally {{ page.whatever_retrieves_the_subsubtitle_### }} as subsubtitle</p> What if instead of the above structure I have: - Title - Subtitle - Subsubtitle The objective is that the

PHP (cli) version doesn't match XAMPP version I installed

◇◆丶佛笑我妖孽 提交于 2019-12-02 18:28:30
问题 Recently I installed XAMPP for doing local development on my Windows 7 machine. I honestly didn't think PHP was installed at all before hand. I installed the latest version of XAMPP and configured for php 5.6.24. I created some virtual hosts and everything seemed to work. I was having an issue and I needed to confirm which version of PHP I was using so I opened up my command line and typed php -v . For some reason it is reporting I'm using PHP 5.4.25. The exact line is PHP 5.4.25 (cli) (built

PHP (cli) version doesn't match XAMPP version I installed

为君一笑 提交于 2019-12-02 12:30:56
Recently I installed XAMPP for doing local development on my Windows 7 machine. I honestly didn't think PHP was installed at all before hand. I installed the latest version of XAMPP and configured for php 5.6.24. I created some virtual hosts and everything seemed to work. I was having an issue and I needed to confirm which version of PHP I was using so I opened up my command line and typed php -v . For some reason it is reporting I'm using PHP 5.4.25. The exact line is PHP 5.4.25 (cli) (built: Feb 5 2014 21:19:58) I don't recall using this version (I had Visual Studio Community installed