I have a shop-skeleton and i have a button “I want this” in the details page, it redirects to a form page where they can send contact info if they want to buy this item. How can i pass the item ID to that page?
in php I would just use GET or POST but can’t manage to do this with grav and twig and markdown…
Not out of the box.
One way to do it is to provide your own templates/forms/default/form.html.twig (the base file that usually defines the form markup) and for example change its markup to
{% for field in form.fields %}
{% set value = form.value(field.name) %}
{% if field.name == 'name' %}
{% set value = 'xxxx' %}
{% endif %}
<div>
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
</div>
{% endfor %}
and instead of ‘xxxx’ put your logic to grab the value you want to add.