Repo can be found here.
- what you were doing or what you tried
- I try to list content through custom categories (aka a perticular ‘exhibition’ eg. called ‘exhibition 1’). On the page of the specific term (e.g. ‘exhibtion 1’) I fetch all content. That works.
- Each of these content items have ‘related content’. I used a custom param to define that related content. So in the config.toml I’ve created:
[taxonomies]
– tag = “tags”
– category = “categories”
– artists = “artists”
– type-artworks = “type-artworks”
– exhibition = “exhibitions”
– exhibition_type = “exhibition-types”
[related]
– includeNewer = false
– threshold = 1 #maybe need to be modified if using search results
– toLower = true
– [[related.indices]]
---- name = “artwork_refs”
---- weight = 100
---- includeNewer = true
- To refer to each other, I add to the content items that need to be related a unique name, usually the name of the item I refer to. In other words in the front matter you will find:
Exhibition 1 - item 1
artwork_refs = "work_of_art_1"
And in the content item “Work of art 1”, you will find the exact ref, namely
artwork_refs = “work_of_art_1”
This is implemented so I can ‘reuse’ works of arts, when building a new exhibition (which is defined by adding a custom category to it, aka exhibition = “exhibitions”).
I use the following code to list the custom taxonomy terms.
<a-scene embedded arjs="sourceType: webcam; debugUIEnabled: false; detectionMode: mono_and_matrix; matrixCodeType: {{ .Params.marker_type_sets}};"> <!-- Get some data before your process --> {{ $exhibition_type := .Params.exhibition_types}} {{ .Title }} {{ range .Paginator.Pages }} Eerste kunstwerk: {{ .Title }}<br> <!-- Get all the data from the exhibition item ref --> {{ $position := .Params.position_artwork }} {{ $size := .Params.size_artwork }} {{ $exhibition_marker_type_set := .Parent.Params.marker_type_sets }} {{ $marker_id := .Params.marker_id}} <!-- Now start fetching related content --> {{ range .Site.RegularPages.Related . }} {{ .Title }} <a-marker type="{{$exhibition_type}}" value="{{$marker_id}}"> {{ .Title }} {{ .Params.artwork_refs }} <a-entity position="{{ $position }}" scale="{{ $size }}" gltf-model="/expo-dko/public/artworks/{{ .Params.model }}"> </a-entity> {{ .Params.credits }} </a-marker> {{ end }} {{ end }} <!-- add a simple camera --> <a-entity camera></a-entity>
- what you expected
- Every time I ‘create’ a new exhibition (aka category), I get a page listing all the ‘exhibitions items’. → Works fine
- Using the related, I then pull the related content of the original work of art. → not consistent.
- what actually happened .
- All category pages seems to be built properly.
- related content is pulled only for specific ‘works of art’. Some are completely ignored, and not found to be related.
- Creating a new exhibition using a custom category creates the page. When I relate the exhibition items with ‘good’ ’ works of art, the related content is shown. When relating them with ‘bad’ works of art, the related content does not show up.