I want to establish a relation between one piece of content to another using front matter attributes.
Let’s say I have the content types games and players. Each player can be associated with multiple games. On the player’s page there should be a listing of the games they play, like so:
I’d like to encode this relationship in the player’s front matter by referencing game slugs, for example:
gamesPlayed:
- deadly-weapons
- fast-cars-5
Based on that info, the player page template should look up the referenced games to display the appropriate title and permalink for each referenced game. How do I achieve this?
I feel like I must somehow be able to achieve this using .Site.Pages, but I did not find the necessary information in the official documentation. Surely there must be an officially sanctioned way to do this.
{{ $characters := where .Site.Pages.ByTitle ".Params.novel" "intersect" (slice .Params.id)}}
From what I can infer about the behavior of this function call, this does not restrict the query to characters, does it?
Let’s say I have a publisher content type which also references a list of novels in its front matter. Won’t this return a combination of all characters appearing in this novel and all publishers publishing this novel?