Quantcast
Channel: User TerranRich - Stack Overflow
Viewing all articles
Browse latest Browse all 41

How do I store content in Drupal 9 about wrestlers and their entrance themes in such a way that a theme entry can be "borrowed" from another wrestler?

$
0
0

I am building a site in Drupal 9 that will, ideally, list the entrance themes of professional wrestlers. I am having trouble figuring out the architecture of such a site given the following requirements:

  • Each wrestler/team is a node (most likely a content type);
  • Each wrestler/team has a listing of one of more entrance themes they have used;
  • Each wrestler/team must be able to "borrow" any of its theme listing entries from another wrestler/team, with the ability to extract information about not only the borrowed theme track, but the wrestler/team from which this theme is being "borrowed".

Here is a real-world example:

  • Triple H has used many entrance music themes in his time in WWE. However, he has also entered the ring to the D-Generation X theme (well, some of the many variations of this theme, anyway).
  • Let's say that Triple H's 12th theme was a "borrowed" usage of D-Generation X's 3rd theme. In other words, DX has had multiple variations of "Are You Ready?"; however, on several occasions, between his 11th and 13th entrance themes, Triple H used the 3rd variation of DX's theme (making this his 12th theme entry).
  • I need to find a way to list and store entrance themes in such a way that I can drill down into Triple H's 12th theme entry to find that it is linked to D-Generation X's 3rd theme entry.

My initial plan was to store Wrestler/Team and Theme Track as content types. Since themes can be re-used, it makes sense to store them as their own reference-able entities. Each Wrestler/Team then has a field called Themes List, which points to a Theme Usage paragraph type. Each Theme Usage ¶ stores: the first date on which this theme was used, notes about its usage, and a reference to the Theme Track content node itself.

However, this soon turned out to be problematic, because you cannot reference specific instances of another node's paragraphs. Meaning, borrowed theme listings wouldn't be possible.

My next idea was to add a Theme Usage custom block type (or content type, but I chose custom block for administrative reasons), so that each individual usage (not only theme tracks) could be an entity that could be referenced. Under this model, each of a wrestler's theme listing entries would point to a Theme Usage custom block. Each Theme Usage has one field that points to the Theme Track (content type) and another that points to other Theme Usage blocks (for borrowed themes).

However, using this method, I'm not sure how to grab information on each borrowed Theme Usage's corresponding Wrestler/Team node using this model. Using paragraphs before, each theme usage was linked intrinsically to the Wrestler/Team node referencing it. But using this second method, there is no similar "ownership" in this manner, meaning that each Theme Usage is a rogue entity that is referenced by a Wrestler/Team node, rather than being linked to a Wrestler/team node.

I'm at an impasse here, unsure of how to implement this architecture in Drupal. I know it can be done, but I'm just not seeing it at the moment.

tl;dr: How do I store content in such a way that each wrestler has their own listing of entrance themes, and that any theme entry can reference any one of another wrestler's individual themes? This reference must reveal information about not only the theme, but the wrestler from which the theme is being "borrowed" as well.


Viewing all articles
Browse latest Browse all 41

Latest Images

Trending Articles





Latest Images