I am building a curated content library for financial content.
I have 3 collections:
Content
Category
Author
In the content collection (where each article will be added) I have a reference field to Author and a multi-reference field for Category (each piece of content might have multiple-categories).
I’d like to understand how I can show an author collection page (showcasing the author’s name, bio, photo etc) that shows the content items linked to him/her (this should be easy because there is a direct link between content and authors thanks to the reference field created in the content collection) as well as the categories in which the author’s content appears (there is no direct link between authors and categories, they only share a reference to content).
please help?
should i be adding refernce fields in the author and category collections also?
All of the CMS collections once created generate a Template Page where you can show the content specifically for the items of those collections. If you want to show content from an Author you need to add a collection of Content to the Author Template page and connect the reference field to the Author. The same thing works for the other collections.
These two articles can help you understand how reference and multireference fields work.
I am busy designing the author template page, and have successfully added a section where"Content" is filtered for “author”. this is easy because the content collection contains a field for author.
However, on the same author template page I am trying design a section where the “categories” is filtered for the author. i.e. “In which categories does this author’s content fit into it?”.
I’m struggling to do this because the “categories” collection does not contain a field for “author”. But the “content” category has reference fields to both category and author.
Do I need to also create a reference field between categories and author or is that unncecessary.
Oh ok, yes in this case you need to reference categories in your authors collection. Otherwise the system doesn’t know about the author’s categories because the only reference is in the content collection.
So in the author’s collection I add a multi-ref field that links to categories? is that it?
And when I first create the author’s entry I’m able to type in their name, bio, photo etc but I leave this multi-ref category field empty and trust the CMS to populate that over time as I add entries to the content collection?
The solution I suggest above doesn’t seem to work.
I create one author, leave the multi-ref category empty, then create 10 dummy items in “content”.
when I then look at the author entry, no categories have been fed back to the multi-ref field.
sorry, I’m just so lost, but it must be possible for the system to run through all the content items assigned to an author and then list the various categories from those items.
To be clear, I don’t know the author’s categories at the time of adding the author entry. The author’s categories will change over time as I add content to the content collection.
However, I’d like to use your site to explain why I’m struggling to do this easily.
As a reminder, this is the workflow I am hoping is possible: Add entries to the blog post collection over time and have all the other relationships update automatically.
From your site, please observe the following:
On the blog post collection you’ll see that Demario Zulauf has published 3 articles.
If you open each article you’ll see that the 3 articles are included in the following categories: 1, 2, 3
If you then look at the author page you’ll see that it says his articles only appear in Category 2.
So the solution created on your project does not dynamically update the categories for each author?
Not possible entirely automatically, you’d need to add every category to the author cms item only the first time, once you add a category to the author you won’t need to do it again.
It doesn’t do it automatically, you’d need to connect the data.