Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Fontmatter caching

Started by Muut Archive 10 years ago · 3 replies · 449 views
10 years ago

Let's start with a big hug: Great platform. I've been looking for a flat cms over the last weeks and this one tops everything I've seen. I've pushed hard, starting right away with some specialized features and there's one big concern: I've seen that a lot of templates use the fontmatter as a "secondary" content store, mostly for structured data like portfolios, etc. Great, that's what I thought in the beginning, but when your run down the road coding a bit you detect that there's something wrong with that: Fontmatter (the header part of a page) has a different cache behavior. It's easy to see: You have to alter a frontmatter setting once the event "onPageContentRaw" triggers (after markdown processing) and within the same procedure you alter the content part. On reload you will see that you lose your fontmatter modifications while the content modifications are maintained in cache: Short story: a page needs four sections: fontmatter (header), storematters, summary and content!
Regards.
uh

10 years ago

A side note: obviously I could store the changes back to disk but this would imply losing simplicity: the modifications include code that is a lot harder to understand and I'd like to maintain things editable for end-users.

9 years ago

Thanks @rhukster for your reply. I've solved this but I will have a look into the shortcode plugin to see if there's a better way.
uh

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2947 9 years ago
Archive · by Muut Archive, 9 years ago
3 1118 9 years ago