Struggling with understanding Drupal 8 - how to grab what I need to use in a template file.

I keep running into cases with D8 where I cannot figure out how to grab what I need to use in a template file. In D7 it seems perhaps more straightforward where you just needed to track down a value in an array. In D8 it seems more involved, to understand classes used and methods you can use. I have used kint() but I really have trouble understanding the output to track down what I need.

Drupal 8 Remote connection to D7 and get files list

I have Drupal 8 site and 4 Drupal 7 sites. I wrote D8 module to retrieve the list of all files in 4 D7 sites. I have done it by creating custom module that switch db connections and retrieve data and generate CSV. i am able to to get data from files_managed table like : public://RFP SA 0417.pdf. But I need to get public file path of these Drupal 7 sites by using mysql query so that I can list out file path in csv.
For example if public file path in D7 site is : '/sites/files/uploads/2016', I have to generate file path as /sites/files/uploads/2016/RFP SA 0417.pdf.

Drupal 8 Group Module: How to add a role to a group member?

Hi,
I am working on a project using Group module. I need to assign a group role to a member programmatically.

I could figure out to get the group roles of a membership using loadByUserGroup() of group role storage class. But I am kind of lost in finding a way to set additional roles. Couldn't figure out an appropriate setter method.

I am pretty new to drupal.org, just learning things the hard way & enjoying it :-). I hope I am asking this question in the right forum.

Hope to find some guidance soon.

Thank you.

D8 RESTful web services save return data?[solved]

First, sorry for my bad english.
I'm try to create custom resource with is code below, but drupal keep my first request return data.

Display the 1st image from field_image in a theme twig?

If a content type had several images, how can we display the 1st image from field_image in a theme twig?

Styling teaser image on custom content type?

My theme has styling for custom content type Article Teaser image (field_image) and I want to apply this styling to another content type (Review) teaser which uses a different image type (field_intro_image). I've copied the node--article--teaser.html.twig to node--reviews--teaser.html.twig which has {{content|without('field_image', 'links')}} within.

But the teaser image does not get displayed correctly. I've also tried {{content|without('field_intro_image', 'links')}}, how do I correctly do this?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x