Is grav suitable for advance needs?

Hi,

New to Grav I used it on few project with very basic needs, and it was very easy. Then I needed to implement advance needs and started to have difficulties.

For example I think it’s overkill to be obliged to create a custom plugin for the sole purpose of adding a path in the templates locations collection.

And now I have the worse difficulties to implement a not-so-complex form, because of the order of events and data availability. I spent literally few days on it, even tried some smelly hacky ways, but could not find any correct way to achieve what I need. I may be rewriting it using only basic PHP features to manage the form (if grav let me do so).

On top of that the documentation is very basic, and I found some advance things by scavenging old issue threads on github. This is not serious.

Now I’m afraid of what is going to happen when I will need to implement other features. I moved from Rails to Grav on few project because I wanted to try some lightweight framework, but really start to feel Grav is intended for basic needs.

Don’t get me wrong, I believe Grav is great, super fast, very easy to learn and use, but I also believe its applications are narrow and it become extremely hard to use with specific needs.

@randoum,

Grav is build to be lean with a small, fast and efficient core. To keep it lean and fast, it depends on plugins for extended functionality. Plugins can be build upon and extend almost everything the Grav core has to offer.

To comment on your specific issues:

  • Adding extra templates
    There is no need to create a plugin for the sole purpose of adding Twig templates. That’s only needed when the plugin itself needs a template to add a front-end ‘widget’.

    Adding templates or overriding existing templates is done using theme inheritance. You can use the 5 steps mentioned in the docs, or use the Devtools plugin: $ bin/plugin devtools newtheme and tell it to override the existing theme. Templates can then be added/overridden in the new themes template folder.

    An inherited theme adding a custom template:

    user/themes/mytheme
    ├── ...
    ├── templates
    │   └── mytemplate.html.twig  <-- adding custom template
    └── ...
    

    A page using a custom template:

    user/pages
    ├── 01.home
    │   └── mytemplate.md         <-- using custom template
    └── 02.typography
        └── default.md
    
  • Forms and data availability due to event order
    Not sure if you are referring to your previous post Form plugin : how to dynamically initialize form value depending on header data from a plugin.
    I have added a reply to that thread.

  • Quality of documentation
    Everything is relative… And also a matter of personal preference. Personally, I’m quite pleased with the documentation.
    Of course, there is always room for improvement. Feel free…

  • Is Grav suitable for complex sites?
    For sure, it has its limitations. The right tools for the right project…
    Do you have some limiting complexity in mind…

I thank you very much on your reply, and the time spent to try and address the specific issues I am facing.

Once again I face specific needs, not something which is covered by Grav core functionality.

There is no need to create a plugin for the sole purpose of adding Twig templates. That’s only needed when the plugin itself needs a template to add a front-end ‘widget’.

I knew how to add templates to themes or pages, it’s in the docs. In my case there is an external component which generate templates files, which are used by different pages, on different projects (thus using different themes). So I needed a separate template directory, such as user/templates. I had no choice but was obliged to create an empty plugin for this sole purpose.

Forms and data availability due to event order

I checked you reply, and I thank you again for your time. Your are giving very useful information, which I already found in the documentation. I’ll comment this point on the other thread.

For the remaining I stand my point, I may not be the greatest developer around, but I’ve been in the game long enough to be able to tell Grav is great for basic needs, and becomes needlessly complicated when you have to go a bit further.

I do not have any intention to be rude, I understand some folks here love this project, and been working on it for many years. I understand each framework have specific pros and cons. I love Rails for example, extremely flexible and super easy to use, but it’s too heavy for some application, and that’s the reason why I switched some of my projects to Grav.