Shortcode #1571
-
Hi @ArnaudLigny, I looked at the documentation to create a "shortcode" but I can't get it to work on my project. I created a 'shortcodes.twig' file in the root of the 'layouts' folder with the following code: {% extends 'macros.twig' %}
{% block macros %}
{% macro don(label = 'Faire un don en ligne') %}
<div class="text-center">
<a href="" class="btn" target="_blank">{{ label }}</a>
</div>
{% endmacro %}
{% endblock %} When I then want to generate it on a markdown file, nothing happens : My text...
{{ shortcode.don() }}
My text...
Thanks in advance for your help ;) Best regards, Matthieu |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
After checking, the youtube shortcode also doesn't work. I must be missing something in the configuration. |
Beta Was this translation helpful? Give feedback.
-
Hello @matthieu2607, Thanks for your report: there is effectively a bug in this experimental feature, sorry :-/ I fixed it in the last version of Cecil, and updated the documentation (https://cecil.app/documentation/content/#shortcodes). Important point: you must use You can see an example on my website: https://arnaudligny.fr/test/shortcodes. Source files: |
Beta Was this translation helpful? Give feedback.
-
Big thank @ArnaudLigny I updated Cecil to 7.25.5 but still got the problem. The repository is here: https://github.com/Pixel-Developpement/defiducoeur Thanks |
Beta Was this translation helpful? Give feedback.
-
Hi @ArnaudLigny I'm an idiot, I didn't apply the code "{{ include(page.content_template) }}" on the right template :( Thanks, it works ;) This functionality of Cecil is top I think Big thanks |
Beta Was this translation helpful? Give feedback.
Hello @matthieu2607,
Thanks for your report: there is effectively a bug in this experimental feature, sorry :-/
I fixed it in the last version of Cecil, and updated the documentation (https://cecil.app/documentation/content/#shortcodes).
Important point: you must use
{% extends 'extended/macros.twig' %}
instead of{% extends 'macros.twig' %}
.You can see an example on my website: https://arnaudligny.fr/test/shortcodes.
Source files: