I am totally new to drupal 8. I have used d7 and i am migrating now.

I have setup a view with 4 articles.

I have managed to print out in a custom views theme

  1. my title
  2. image url
 {% for row in content['#view'].result %}

   {% set image_uri = row._entity.field_image.entity.uri.value %}

   {{ image_uri|image_style('blog_298x200') }}

   {{ content['#view'].field['title'].value(row) }} 

 {% endfor %}

My template file is called : block--views-block--main-article-block-miniatures-slider.html.twig

I would be very greateful for any tip for getting what i need :

  1. The node url
  2. The taxonomy (field_categorie) and its url
  3. Created date

I have installed the tweak twig module to make things easier for me

  • IMO drop the complexity and use a view mode output for the view. drupal.org/docs/8/api/entity-api/… – Kevin Mar 26 '20 at 17:23
  • Well i want to use the view block to show up news as slider. Also i do not want to install any module for that – yazzou Mar 27 '20 at 5:25
  • View modes don't require a module and the block can still be used. – Kevin Mar 27 '20 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.