Timeline for How can I target the first item in a view?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 23, 2020 at 12:30 | comment | added | No Sssweat | While this answer works, not the best, you're making things more complicated than it needs to be by having to manage two views. | |
Dec 23, 2020 at 5:05 | vote | accept | jfc | ||
Dec 23, 2020 at 15:19 | |||||
Dec 23, 2020 at 1:35 | comment | added | Patrick Kenny |
@jfc You can definitely have separate twig files for each view display. If it's not being picked up, double-check the file name, clear the cache, and so on. The pattern is usually views-view--VIEW_MACHINE_NAME--DISPLAY_MACHINE_NAME.html.twig .
|
|
Dec 22, 2020 at 22:53 | comment | added | jfc | Do you know if I can edit the attachment on a different twig file? Before the attachment the debugger suggets - node--view--news--attachment-1.html.twig Right now my file is node--view.html.twig, and it's still loading that even if I create a node--view--news--attachment-1.html.twig file. Do you know if I can have 2 files? 1 for the attachment, 1 for my other content? | |
Dec 22, 2020 at 21:42 | comment | added | Volker | Yes, just output them as blocks. Alternatively you can use an 'attachment' as display and attach it before or after a page display. | |
Dec 22, 2020 at 21:38 | comment | added | jfc | Can I display both views on one page? | |
Dec 22, 2020 at 21:32 | history | answered | Volker | CC BY-SA 4.0 |