0

I have quite a complex content structure and found the paragraphs module (in combination with taxonomies) can be very powerful for creating complex compound fields and dynamically reusing existing content types.

Example: 1 content type "equipment" tagged with a term from a taxonomy "mobility devices" (terms: car, aircraft, bike...) and with different fields of paragraphs types representing the different attributes for each of the devices. This way I'd only use the car_paragraphs_field if the equipment is tagged as a car and leave the other paragraphs fields blank. This in contrast of having multiple different content types "car", "bike"...

I'm wondering whether this a reasonable approach in terms of later displaying data in views, storing data to the DB, internal Drupal complexity/load when having let's say 100 different paragraphs types and only using 1 for each new content (i.e. leaving many paragraphs types fields blank), instead of having one separate content type for each.

  • 2
    Proper content modeling is important. I wouldn't go full boat on Paragraphs, but use them for 'display pieces' on content. If it is important and pertinent to the content type, use structured data. – Kevin Apr 6 '18 at 16:17
  • what exactly do you mean with structured data? – theuni Apr 6 '18 at 17:05
  • 1
    Actual fields. Not paragraphs. – Kevin Apr 6 '18 at 17:07
1

Personally I don't think this is a good use case for paragraphs. I don't see any benefit of having only a single content (node) type, you are just moving comeplexity from nodes to paragraphs.

I think the key here is to carefully plan and reuse fields across entities. If your car equipment and your plane equipment both have a weight attribute, reuse the same field (or to be more precise: reuse the field storage), so e.g. you can use it to as filter in a shared view for both equipment types.

  • Ok so that'd mean having separate content types for each "equipment" but reusing fields/field storage wherever possible. I was only hesitant to do it this way as this might results in many many content types... – theuni Apr 8 '18 at 8:25
  • Yes, that's correct, but if your dataset is that big, you either have a lot of node types, or you have a lot of paragraph types. As long as using paragraphs doesn't save you from creating additional entity types, be it either additional paragraph types or additional node types, I can't see any benefit in using Paragraphs at all. – Hudri Apr 9 '18 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.