I use paragraphs with my content type. I need to show weight (order) value of each paragraph in my twig template. I can change weight with select box when I edit the node, but I can't figure out how to get it in twig.
I thought it would be something like this:
function ws_preprocess_paragraph(&$variables)
{
$par = $variables['paragraph'];
$myweight = $par->weight;
}
Please help)
{{ loop.index0 }}
in a field template likefield--field-paragraph.html.twig
– 4k4 May 15 '17 at 9:00