Is it possible for an collection item to reference another collection?

Is it possible for an collection item to reference another collection?

I want to design a blog with multiple images in a gallery, but I can’t use the multi-image cms field as I need caption for the images (multiple captions, the ‘alt text hack’ won’t work).

If I’m interpreting your schema goals correctly, you’re trying to display a different set of photos with each blog post, including a caption per image.

To do that;

  • C2, C3, C4 should be one collection “Tasty food images”.
  • Add a Ref to that collection to point at Item

In your Item Collection Page, you’ll drop a collection list, bound to Tasty food images, which filters them to “Item = Current Item”. That will show only images for the current blog post, along with caption, link, photographer, whatever else you want.

Thanks for the reply. Where do I add the filter “Item = Current Item” that you are suggesting? I looked it the conditional visibility settings but ‘current item’ isn’t an option.

Look at the settings panel for your Collection list, and you’ll see filtering.

Do you have an example of this functioning? Filtering ‘current item’ only seems to be working if the collection you’re referencing matches the collection pages you’re working on.

Yes that’s precisely the goal, your Blog post pages contain your photo collections, but only the photos & captions for that Blog post.

Aah sorry! No I am trying to put the photos from one collection into the collection page template of another.

Yes that’s what the Collection List is for.

I’m not sure what’s tripping you up because it’s is a pretty basic setup-
Do you want to share you’re readonly project link and explain where you’re getting stuck?

The basic setup I can get through, but a collection list in a collection item? It inside a collection list item is what I am going for, it seems it’s not possible. I think it might be my sketch doesn’t describe it well.

That’s what a Collection Page is. It represents a single collection item, in this case the one Article you are currently viewing, plus its connected images.

COLLECTIONS

  1. Articles, as many as you want
  2. Photos, contains a ref field to Articles, plus your image and caption
    • each photo identifies the Article it relates to

ARTICLES COLLECTION PAGE

  • Contains the article title, detail, text etc.
  • Contains a Collection List, bound to Photos
    • Filter it to only display photos where the photo’s “Article = Current Article”
    • In those Collection List items, show the image, and the caption of that photo

Riiight. Sorry! Thanks for you patience. I got it now, the stumbling block was that I didn’t realise you were saying each photo should reference the article it belongs to. Once I had understood that, then the “Item = Current Item” option was available as a filter.

1 Like

Yay, thought I was going mad, but I didn’t have time to do a mockup and verify it still works that way. :wink: Glad you found it.