How to store liquid templates in a database?

224 views
Skip to first unread message

Gitted

unread,
Nov 23, 2015, 8:04:34 PM11/23/15
to Liquid Templates
Hello,

I believe liquid assumes the templates are stored on the file system correct?

Is there a way to load them from the database or another data store?

What I ideally want to do is, for a given page, I want to know all the templates to load (because there could be inner templates) and then load the templates and not have the template on the fly load the templates while it is parsing.  Is this possible?

Mason Hale

unread,
Nov 25, 2015, 2:48:22 PM11/25/15
to liquid-t...@googlegroups.com
Is there a way to load them from the database or another data store?

What I ideally want to do is, for a given page, I want to know all the templates to load (because there could be inner templates) and then load the templates and not have the template on the fly load the templates while it is parsing.  Is this possible?


It is possible, but requires some significant work.

Fortunately, Chapter 3 "Retrieving View Templates from Custom Stores" in the book "Crafting Rails 4 Applications" by José Valim that walks through exactly how to solve this problem.


Mason
 

Reply all
Reply to author
Forward
0 new messages