LostKobrakai / twig

Twig adapter for fractal
MIT License
4 stars 2 forks source link

Getting started #1

Closed tnottu closed 8 years ago

tnottu commented 8 years ago

Hi!

Thanks for telling me about this adapter :)

Could you give me some basic instructions on how to use this? I got it to render my components in Fractal, but for some reason it prints the code escaped. For example, I get this:

<button class="button button--default  theme--default">
    <span class="button__layout">
        <span class="button__text">Click me!</span>
    </span>
</button>

When it should be:

<button class="button button--default theme--default">
    <span class="button__layout">
        <span class="button__text">Click me!</span>
    </span>
</button>
LostKobrakai commented 8 years ago

That's strange. Could you please add a console.log(html) before this line? https://github.com/LostKobrakai/twig/blob/master/adapter.js#L45

If it's correct html it's the node part, which encodes the markup. Otherwise it's php to somehow return encoded html.

LostKobrakai commented 8 years ago

Also while it's for a different cms you can see my setup here: https://github.com/LostKobrakai/processwire-fractal

tnottu commented 8 years ago

This was my own mistake after all. I had {{ yield }} in my preview template code, which worked earlier, when using my own (much simpler) TWIG adapter. I modified the tag to {{ yield | raw }} and now everything seems to work again :)

I will look into your setup for Processwire and hopefully I can learn enough to use this adapter with WordPress as well!