Timeline for Getting index of item in items inside twig template
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 25, 2021 at 23:57 | comment | added | Vishal Kumar Sahu | loop.index0 is out of context here. | |
Feb 8, 2019 at 13:41 | comment | added | Ziftman | did you try loop.index0? | |
Nov 30, 2018 at 15:26 | vote | accept | Vishal Kumar Sahu | ||
Aug 23, 2017 at 12:23 | comment | added | Vishal Kumar Sahu | I think that should be default thing to index everything whatever is being looped... Anyway I am going for different approach to achieve these things... | |
Aug 19, 2017 at 16:34 | comment | added | 4uk4 | I wouldn't say you need tweaking with CSS. You simply can target any element in the paragraph, which is inside of the field div with the indexed class. | |
Aug 19, 2017 at 16:11 | comment | added | Vishal Kumar Sahu | There are other solution, JS/CSS or even tweaking with PHP in Drupal. But doing it in twig way would have been even better solution. :-) | |
Aug 19, 2017 at 13:09 | comment | added | 4uk4 | I tried to explain why referenced entities like paragraphs are unaware of their position in the field and that there are many reasons not to try to make them aware. And that probably you don't need this, because CSS can work with the structure as it is. | |
Aug 19, 2017 at 12:10 | comment | added | Vishal Kumar Sahu | Thank you for your quick reply. Is there any other work around so that I can retain the current structure and get the index. | |
Aug 19, 2017 at 11:48 | history | answered | 4uk4 | CC BY-SA 3.0 |