Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor error.md and .twig to default? #34

Open
aivar opened this issue Sep 9, 2018 · 1 comment
Open

Refactor error.md and .twig to default? #34

aivar opened this issue Sep 9, 2018 · 1 comment

Comments

@aivar
Copy link

aivar commented Sep 9, 2018

I just spent an hour trying to understand why the PLUGIN_ERROR:ERROR translation had no effect on out-of-box grav installation. As it turned out, Quark (default theme) overrides error.html.twig with its own, which uses different variable (ERROR).
So here is my issue:
Both grav-plugin-error and quark theme (i know there are more..) define h1 header in the twig files. Error page itself is not defined in theme, but exists in (mandatory) error plugin. This creates situation, where single functionality (showing error message content) is divided into two different places with conflicting translations. This will be the same for other themes as well, as the plugins error.html.twig is too basic to be useful without theme overriding it, which means the theme twig needs to define h1 again.

Maybe I am missing something obvious here, but I do not see real benefit in having in plugin error template and error page over having default.md page and allowing theme default template render it. If user needs to define separate template for error pages or start using the theme provided one, they could easily create /error/error.md and set template there.

So, what i suggest for both quark theme and plugin-error:

  1. rename plugins error.md to default.md (including php change)
  2. move h1 header from plugin error.html.twig to default.md
  3. remove plugins error.html.twig completely (expect theme to have default template)
  4. in quark error.html.twig remove h1 header (or remove error.html.twig completely, as it is no different from default) and allow error plugin OR custom error page provide page content.

1-3 are not breaking changes toward out-of-box installation, but may break other themes that have worked around the need to provide error page header themselves.

Alternatively, the translation could be explained in the readme more clearly..
Thoughts?

@CarlSinclair
Copy link

I just created a page that I can modify from the admin panel and add translations etc and modified the plugin template to only spit out the page contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants