Questions tagged [grav]

Grav is a open-source, flat-file, PHP-based CMS.

Key Technologies

  • Twig Templating: for powerful control of the user interface
  • Markdown: for easy content creation
  • YAML: for simple configuration
  • Parsedown: for fast Markdown and Markdown Extra support
  • Doctrine Cache: for performance
  • Pimple Dependency Injection Container: for extensibility and maintainability
  • Symfony Event Dispatcher: for plugin event handling
  • Symfony Console: for CLI interface
  • Gregwar Image Library: for dynamic image manipulation

It's focus is on quick set-up and extensions via plug-ins and themes.

More Information

207 questions
1
vote
0 answers

Inheritance with Twig in Grav

I’m new to Twig, having just recently built a blog using Grav CMS, which I’m also new to. I added the following to one of my partials: {% set csp_nonce = 'nonce-' ~ random_string(20)|base64_encode %} I could then access it later in the same…
Graham Gold
  • 2,435
  • 2
  • 25
  • 34
1
vote
1 answer

Grav Page Routing in Twig Template in Multilanguage Setup

Problem Using Grav CMS (v1.5.8) I want to redirect the user to other pages. The page is a multilanguage setup and depending on the selected language, the route to the the base / start pages for the languages are simply: www.example.com/…
mmr
  • 383
  • 3
  • 12
1
vote
1 answer

How to easily migrate a Grav-based site to Wordpress

I have a simple website developed with the Grav CMS. Now, it has many pages and I really want to migrate it to the WordPress CMS. Is there anything to do in order to make the migration process smoother and pain free?
AFA Med
  • 241
  • 2
  • 11
1
vote
1 answer

GRAV display all page.media items

I'm creating a website using GRAV CMS and I stumbled upon a problem that I need help with... I created a page that I want to list out all pdf-files that I upload in GRAV. I want the output to look something like that: The pure hardcoded HTML for…
weinde
  • 1,074
  • 3
  • 13
  • 32
1
vote
0 answers

Use Page content in Blueprint

I try to get data of a page into a blueprint in the admin plugin — using the themename.php script in my theme folder. people.md — the content of the page I need --- title: Test Page people: - Holger - Peter - Simon --- person.yaml — the yaml…
gustav
  • 336
  • 3
  • 12
1
vote
1 answer

How to get the GRAV git-sync plugin working in Azure Websites

I have created an Azure App service website and uploaded the Grav CMS. While the app works fine the GitHub synchronization doesn't work. When trying to use the git sync plugin I get an error message "The GitSync plugin requires the git binary to be…
Jan Dryk
  • 11
  • 3
1
vote
2 answers

PHP create new instance of child class based on existing instance of parent class

I know this is going to be a bit of a weird one, so I'll try to be as brief and as clear as possible. I am working on a plugin for Grav. I have determined that the most effective way to accomplish my goal is to extend one of the base classes, Pages.…
Dalen Catt
  • 111
  • 1
  • 9
1
vote
1 answer

Grav/Twig get title of twig expression

I want to get the title of a linked page, which is linked by a twig expression. #TitleHere I tried to get the title with page.find but this doesn't work at all. I don’t want to create a backend field…
1
vote
1 answer

GRAV cms Twig access to specific array index in theme blueprint yaml

I have a theme I made that hold some configuration value in its config file: enabled: true dropdown: enabled: true motto: 'il desiderio di coltivare.' color1: '#0522ff' color2: '#ff0000' custom_logo: user/themes/terretinte/images/ttlogoh.svg: …
Zaldor
  • 11
  • 1
  • 5
1
vote
1 answer

Sub-navigation in Grav CMS

I want to make a subnav for my Grav Theme. I already saw a question on this topic: GRAV subnavigation {% block navigation %} {% macro loop(page) %} {% for p in page.children %} {% if p.visible %} {% set active_page = (p.active or…
joelluethi
  • 21
  • 3
1
vote
1 answer

Make slug and menu location independant in GRAV cms

Is it possible to have a simple URL like http://example.com/page_slug and add the page to whatever position I want in the menu especially a child position? The problem is that whenever I attach a page to a parent menu, I got many levels in the slug…
AFA Med
  • 241
  • 2
  • 11
1
vote
2 answers

Twig for loop - output only parent if any children exists

These lines prints all categories and the products within. But if the category has no products the category title is still printed. {% for category in categories %}

{{ category.title }}

{% for product in products if…
NinjaFart
  • 1,626
  • 1
  • 20
  • 24
1
vote
1 answer

Custom theme's blueprints not being detected in Admin plugin at all

Following this example: https://learn.getgrav.org/forms/blueprints/example-page-blueprint I created my video.yaml file under "user/themes/MYTHEMENAME/blueprints", contents of its file: title: Gallery '@extends': type: default context:…
Alexander Kim
  • 17,304
  • 23
  • 100
  • 157
1
vote
1 answer

Issue when deploying GRAV site using git on Gandi.net simple hosting

I have a new site that I have prepared with Grav and that I'm willing to deploy on my Simple hosting instance on gandi.net. I have saved my developments using git on my bitbucket account. All fine. I have configured my git access to the simple…
Xavier
  • 41
  • 5
1
vote
1 answer

Grav - Parse URL

I want to define a new template called "product". This template calls an external service and retrieves the information about that specific product. That is easily done with a custom plugin that access the product information. Information on how to…
M.E.
  • 4,955
  • 4
  • 49
  • 128