gantry5
gantry5 copied to clipboard
Extendable YAML and Twig files
This is to remind, consolidate and group together a couple issues we have open that should get addressed contemporary. [#751 #782]
- [x] YAML files should be extendable other than just overridable like it is now. Allowing for portions of yaml files to be reworked without having to copy over the original.
As this gets addressed, it's worth noticing that we do still need to add support for
theme.yaml
[in wiki agenda] overrides and it could be the perfect opportunity to implement that as well. - [ ] It should be easier to extend blocks of a twig file without the need of overriding the whole thing. As we discussed, this is very complicated matter and it might not even be doable with just the Twig tools at our disposition.
However, the discussed approach of relying on
<file_name>-custom.twig.html
, to detect if there are extensions to a twig file, seems to be the most promising and viable approach by allowing users to simply extendblocks
portion of a twig file.
These are both important implementations that need to be addressed.
This also relates to #306.
We really do need this. :)
+1
I've been working on YAML part, but its not going to make it into 5.3.0 as it still has some bugs in it.
Where can I see how this works? Thanks...
Heh, it is documented in Grav: https://learn.getgrav.org/forms/blueprints/advanced-features
@mahagr & @w00fz I know this has been discussed quite a bit over the years and its obviously not an easy one to fix. Is there any progress in being able to do this, specifically concerning the /gantry/theme.yaml
file?
I have really been looking forward to this coming to fruition for quite some time now. I got to thinking about it again due to GDPR as well as recently with issue #2451.
What I'm running in to since GDPR is some sites where customers do not want to use Google Fonts and would prefer to load the fonts locally. However, making that change in the /gantry/theme.yaml
file means that every time I update Gantry 5 I have to go in and manually update the /gantry/theme.yaml
file.
I also have a couple of sites where I have been loading the fonts from Page Settings using Google Fonts where the customers are not so concerned about GDPR and Google Fonts. However, one of the fonts being used is not rendering properly when the site is viewed in Greek so I had to load it locally via /gantry/theme.yaml
. Again, I have to update that file manually whenever I update Gantry 5. This creates more work on my end.
I also know that this was brought up by @alisamii when he opened issue #782 on Sept. 2nd, 2015.
What is the likelihood of this particular issue getting some more attention in 2019?
@N8Solutions
I've finally implemented a way to use your own custom/gantry/theme.yaml
file. I chose to go for a simple solution: if the file exists, it will be used instead of the default file. So if you override the file (or any other file), it is a good idea to check now and then if it has changed. Generally, themes have been very stable and most changes are between larger versions: 5.4 -> 5.5 -> 5.6...
Please check if it now works for you in CI build: https://gantry.org/downloads#ci-builds
PS. make sure you pick the correct file for your CMS.
Thank you @mahagr! I'll check this out as soon as I get a chance.