Retrieving value of paragraph type with entity reference revision through preprocessor

by Guruprasad   Last Updated June 12, 2019 15:07 PM

I have created a paragraph type which has field of type entity reference, link, plain text.

Now I want to fetch the values present in these through the and display it in the custom template(twig).

Can anyone please let me know how do i do this?

I have written a hook function in the preprocessor, but unable to fetch values of paragraph types.

Eg of my paragraphs type:

  1. Section
  2. Box

In the section contains 2 fields, first is the title which is a plain text and second is the box, which is an entity reference revision

The box, is a paragraph type which has many fields like

  1. Link
  2. Image
  3. text field
  4. Wysiwig

Now how do i access values present in these through the hook function and display the same in twig template.

Tags : theming hooks

Related Questions

Updated July 19, 2016 08:03 AM

Updated June 04, 2015 22:03 PM

Updated March 02, 2017 13:07 PM

Updated March 07, 2017 19:07 PM

Updated April 30, 2017 09:07 AM