Forum

Thread tagged as: Question

Collections question.

Hi, I'm looking for a way to assign an image from gallery app to a collection. In fact, I'd like to bulk upload images in a classic gallery and then, when editing each image, having the possibility to assign it to a collection and/or a category. For example, in a gallery called Nature, such image is a bird so I could assign it to a collection named "birds", this bird is a sparrow => collection "birds" + collection "sparrow" this is a tree sparrow => collection "birds" + collection "sparrow" + collection "tree habitat" and so on… The predefined collections should appear as checkboxes. At the end, I'd like to dynamically generate galleries. Thanks in advance for you advices.

Hugues Mertens

Hugues Mertens 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The Gallery app is pretty old, so handles images itself rather than using the main Assets system.

Have you already built your solution on top of the Gallery app?

Not yet, I'm just setting an estimation for a customer whose current gallery has interesting filtering functions even though it's made in a static base.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, I would plan to not use the Gallery app if you can do so.

Thanks Drew, my only concern is about bulk uploading. Would it be achievable at my level to build an application with the ability to create a separate folder for a particular gallery and bulk upload the resources inside it? So it would be a simple question of tagging the assets using the collection feature. Even better, the application could have the ability to tag each ressource upon upload.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What do you mean by bulk uploading? Did you realise you can drop multiple files into Assets at any point?

No, I can't do it any more since version 3. Did I missed something?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that functionality hasn't gone away.

I've got it at last! you cannot do it directly from the asset manager, but it's possible through the collection itself. How can I give the user the ability to create new collections and having them displayed dynamically in a page? In other words, is there a way to - list the collections in order to build some kind of navigation for the collections? - dynamically generate galleries by filtering the collections, I mean passing the collection title or id into the page function?

Drew McLellan

Drew McLellan 2638 points
Perch Support

The perch_collection() function takes a string as the name of the collection. That is usually hard coded, but there's no reason it couldn't be dynamic.

It would be necessary for this to be able to retrieve the collections listing with some kind of perch_collections() function. I don't see how to do it.

Drew McLellan

Drew McLellan 2638 points
Perch Support

There's nothing for retrieving a list of collections at the moment.