0

I have two fields in a custom paragraph type, Person. Each instance of paragraph type holds two values, that is, it will include two persons/people. I am working on the theme of the type (paragraph--person.html.twig). I would like to display to display each record in separate columns. Person 1 should be in Column 1 and Person 2 should be in Column 3.

Name of paragraph type - person Person fields - field_name, field_bio The person paragraph type is included in Page node type

Here is what I have tried.

   <div class="row">
 <div class="col-4"> Column 1 {{ content.field_name.0 }}
   {{ content.field_bio.0 }}
 </div>
 <div class="col-4"> Column 2 </div>
 <div class="col-4"> Column 3 {{ content.field_name.1 }}
   {{ content.field_bio.1 }}
 </div>

The result is nothing is printed in Column 3 and the row is repeated. Any assistance is appreciated.

1 Answer 1

0

Sounds to me like you need to be altering the field template rather than the paagraph template as it would be the entity reference field (which references the paragraphs) that would be set to multiple values.
If you have twig debug mode on, you should be able to see the name of this template in the html source.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.