0

I'm a bit lost about how Drupal manage content.

For example, I want to create a new content type called Game. When I create a "Game" I want to introduce "Platform" and "Release date".

For example:

Title: Sonic the Hedgehog.
Description: Whatever.
Released on:
Platform: Mega Drive Date: 23 june 1991
Platform: Arcade Date: 1991
Platform: Nintendo Switch Date: 2018

I want both platform and date to be keys for sorting games, so clearly platform might be a "vocabulary" in taxonomy?...I'n not really sure. How would be your take on this?

0

It seems Field collection/tabular data solution is what you're after.

In Drupal 7 the popular module for that was Field collection.

In Drupal 8 Paragraphs seems to be popular, although its description is pointing heavily to the current fad of designing content pages with separate sections, it is still a solution that allows for a more structured group of references. Then you reference the Paragraph you constructed for this particular purpose from within your nodes.

A more abstract solution similar to Paragraphs but more flexible is Bricks​. Although its description is pointing to Layout integration you don't have to be distracted by that, it's still a great entity reference grouping mechanism you can use to construct your node structure.

I think Bricks might be better suited for your particular case since you'll always be using the same platform/date structure, but investigate both and see which fits you best.

In short, you need references from your nodes to the platform, and date, and they need to be grouped in pairs. You can do that by creating the abstract reference (brick) from your node, that in itself holds two other references (to platform and date). Platform items (entity reference) can be Taxonomy terms, Date can also be Taxonomy or Date fields, it all depends on your details, what type of data it is, how you're expected to manipulate it, etc.

  • 2
    Some advice - pick the best fit for your use case but don’t mix them.. some do, I wouldn’t. Each has its own paradigm. – Kevin Apr 9 at 22:53
  • Personally rec paragraphs over bricks unless you need the extra functionality bricks can provide, e.g. the layout stuff, and it doesn't sound like you do. Disclaimer: I'm not a big fan of bricks. – sonfd Apr 10 at 1:24

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.