overriding views-view-unformatted.html.twig - theming views-view-unformatted.html.twig in Drupal 8, 9

If u want to add custom html in views and custom html for field follow the below step.

1.  copy views-view-unformatted.html.twig from core/views/templates and paste in your custom theme folder .


overriding views-view-unformatted.html.twig - theming views-view-unformatted.html.twig in Drupal 8, 9



overriding views-view-unformatted.html.twig - theming views-view-unformatted.html.twig in Drupal 8, 9












2. if you want to theme for a particular  view/ page naming convention below

views-view-unformatted--[view name]--[page/block id].html

suppose I have View name is [exhibition_resources] and page id [page_1] custom view twig tpl name is

views-view-unformatted--exhibition-resources--page-1.html.twig

overriding views-view-unformatted.html.twig - theming views-view-unformatted.html.twig in Drupal 8, 9













for print field value follow below code

{{row.content['#row']._entity.field machine name.value}}

for getting image and pdf url kindly use below code

{{file_url(row.content['#row']._entity.field_pdf.entity.fileuri)}}









1 comment:

Rahul Sharma said...

Nice Information and keep posting this type of Information. We have also some new about Top 10 CBSE Schools in Meerut. We provide best Banquet Hall in Meerut , Google My Business Page

Write a program in PHP to reverse a number

A number can be written in reverse order. For example 12345 = 54321 <?php   $ num = 23456;   $ revnum = 0;   while ($ num > 1)   {   $...