0

There is a paragraph type 'paragraph01', it contains two fields: field_paragraph01_01 and field_paragraph01_02.

And a content type contains two node fields: field_01 (referenced paragraph01),field_02 (referenced paragraph01).

Is there possibility to achieve below?

Node field: field_01 just show field_paragraph01_01 both form mode and display mode, and node field: field_02 just show field_paragraph01_02 both form mode and display mode.

3
  • Yes it's possible, but it will require custom coding. Why not keep it simple and have each field in separate paragraph types?
    – No Sssweat
    Commented Jan 3, 2019 at 13:31
  • Yes. It is simple when we have each field in separate paragraph types. Actually in my real project, the paragraph type contains more than 2 fields. I am thinking using view modes, but I don't know how to achieve above goal.
    – Basic
    Commented Jan 3, 2019 at 15:15
  • Display modes would allow you to create unique twig template files for each display, and with them, you could drill down via twig to your needed fields and values. However, you would need views or other methods to aggregate the unique display mode fields on one page. Alternative ideas: 1) Just use a single node template file. 2) Add a new boolean or select field like show field a/b to the paragraph type, which would at least give you something to compare against in your paragraph twig file. I think the closer you can get to the paragraph the better. Commented Jan 3, 2019 at 22:58

0

Your Answer

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

Browse other questions tagged or ask your own question.