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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Calling a link in twig from MD file

Started by Duc 8 years ago · 1 replies · 582 views
8 years ago

I would like to call a link in a twig from MD file.
This link is a 'buy it' button for snipcart.

TWIG
<a href="#"
    class="button primary snipcart-add-item"
    data-item-id="{{ page.header.product_id }}"
    data-item-name="{{ page.header.title }}"
    data-item-price="{{ page.header.price }}"
    data-item-url="{{ page.url }}"
    {% spaceless %}
    {% if cart_img %}
    data-item-image="{{ cart_img.cropResize(50,50).url }}"
    {% endif %}
    {% endspaceless %} >
<i class="fa fa-shopping-cart"></i> Add to Cart
</a>

In the MD file I would to wrap this link as such.

TXT
[buy it](/link)
8 years ago

Maybe you can do that with the shortcode plugin?

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 53 10 hours ago
Support · by Anna, 3 days ago
2 60 13 hours ago
Support · by Justin Young, 14 hours ago
1 30 14 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago