Closed Jerska closed 9 years ago
I do not understand why having liquid in the backend requires you to change hogan options in the frontend.
Maybe i am missing some info.
Maybe i am missing some info.
Yes because the hogan templates are defined in liquid files :) So while rendering the page, the hogan {{ }}
are interpreted as liquid tags :/
That being said @Jerskouille, not sure how to deal with the default templates that are actually using {{}}
, could that be overridden on a case by case?
Oh yes, right, it wasn't really clear, I've updated my first message. About your last question @redox , I hadn't thought about it. Maybe don't use the specified options if 'template' isn't specified, but it doesn't feel right.
Jekyll also uses Liquid, and I had to use {% raw %}
and {% endraw %}
to be able to write Mustache inside Liquid. I don't know if this is a default Liquid tag or a Jekyll one, though.
https://github.com/pixelastic/blog.pixelastic.com/blob/master/app/_layouts/default.html#L72-L81
I feel that this will be a better way of handling the issue than changing the Hogan config.
I believe it is liquid related, since this also works in Shopify, but having to put it all the time tends to get messy, and you might want to mix liquid and Hogan, hence my fallback on custom delimiters.
So we need to do this right?
Shopify assets already use a templating engine called liquid in the back-end with the same delimiters as mustache (
{{ }}
). This is the only way Shopify user's can use their Shop configuration to adapt the design of a template for example. This is why I've made our templates also liquid files, so I have for example asnippet/autocomplete_product.hogan.liquid
.Hogan exposes an option to change its delimiters, it's done like this:
This options can't be global to Hogan, so you have to give them to each
Hogan.compile
. It would be great if we could have ahoganOptions
parameter in the constructor ofinstantsearch.js
.If that's ok with you, I can probably do the PR myself.