0

Alright, this is taking so much time than expected. I'm having a comment type "Default comment". The comments under this comment type is published and created as nodes under "level3" content type. The content types look as below:

enter image description here

I have related the Level3 content type with Default comments using "comment ID" field. So every time when the comment is published under level3, the comment ID will also be updated with the ID of the comment. Now, I have a view that reads the data from both Level3 content type and Default comment type. My view looks as below:

enter image description here

so I'm trying to read the comment fields and Level3 fields using the "field_comment_id" relationship. it is a reverse relationship and I can see the view output correctly on the grid. I want to read the fields from the view grid and tried the below queries:

$entity->field_level2->getValue() 

$entity->field_comment_id->referencedEntities();

none of them are working. any clue on how to read the fields based on reverse relationship?

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.