I have a collection A with a set of items. The structure of the collection A calls a collection B in Reference Field.
In my collection A, I also call on the collection A itself, and thus with another Reference Field connected to the collection A. In a collection page, the Reference Field to collection B does not appear in the Reference Field to collection A.
Itâs difficult to determine what youâre hoping to achieve here, but if youâre trying to invert the reference, thatâs not possible in Webflow. Webflowâs CMS appears to be based on some variant of MongoDB which is not a relational database.
If you have B ref A, then you cannot create a collection list of A and hope to find the multiref of Bâs that have referenced it.
You can only (multi)reference a Collection, not a field within a Collection. Itâs just a limitation of the Webflow CMS.
Instead, the approach that people take to overcome this is Lookup Tables.
Iâm not clear if theyâll work for you or not, but, hereâs an overviewâŚ
You hold the item-id of the Collections item you want to reference in an external table (Airtable, Make / Integromat Datastore, etcâŚ).
So you could track your self referential reference (Collection A referencing itself) in the lookup table and which Collection B item references it. Then use the Webflow API to grab that item by itâs stored id.
Hereâs an overview of this (though with a different example than what youâre asking for, but the same applies to you):
Sorry for the delay in responding, I did not receive notification for your responses. Iâm trying to be clearer with a new more concrete diagram.
In my example: in a âcollection page templateâ of the collection A âModels carsâ, I have this same collection A in reference field to itself. I canât access to the collection B âBrandsâ from the collection A which is in reference field.
Think of each reference field as a âhopâ.
Currently Webflow allows only one âhopâ via a reference field from A â B
Your page design requires A â A â B = 2 hops, which isnât supported.
What you can do instead is put your âalternativeâ cars in a multi-ref field, rather than two single-ref fields. In this case, your structure changes to;
A â A â B
Which will work just fine. Your page structure will become;
A's collection page
Alternates collection list, bound to your multiref of A alternates's
A alternate content
B content ref'd to that A alternate
It works because inside of that collection list, Webflowâs context becomes the alternate item, so B is only one hop from the current A alternate.
Bonus, you can have more than 2 alternates if you want.
Here is the project share link with the db setup and the collection page.
At the end of the day, you most likely donât want to do this (even through its possible). Youâll quickly run out of reference fields. You get a max of 10 on the higher priced tiers, only 5 on the lower priced tiers.
Instead you want to use something like lookup tables (mentioned previously) that removes those limits.
Regardless, that shared project should get you there, or give you enough to tweak for your needs, on your own.
I really want to thank you both for your explanations. I have implemented your advice and I have integrated my car scheme in a mini test project you can have a look at.
I see perfectly that the fact of putting the âalternate carsâ in Multi Reference Field instead of a simple Reference Field allows to access to the âBrandsâ collection which is itself a Simple Reference Field of the âModelsâ collection. So from a âModels carsâ Collection Page, I have access to all the information and I can display as many alternatives as I want. Practical and efficient.
Concerning the âhopâ. I confess I still have trouble understanding why the Multireference Field allows to have only one âhopâ and not two to access the âBrandsâ collection, even with Michaelâs explanation
Webflowâs context becomes the alternate item, so B is only one hop from the current A alternate.
A â A â B = 2 hops A â A â B = 1 hop
Concerning the limit of the number of reference fields imposed by the Site Plan, I understood the possibility to use lookups. This is what I do in my real project within Airtable that I synchronize with the Webflow CMS. Chrisâs articles on this subject are extremely interesting and Iâm going to deepen them.
On the collection page the context is the page item being viewed, whereas in the collection list, the context is each item within that list.
The multi-ref must be bound to a collection list, so youâre effectively shortening that distance by navigating the first hop using the collection list itself, and then your target data is only one ref-hop away.