Forum

Thread tagged as: Question, Api, Gallery

Working with the Assets class

Hi.

I need to access images uploaded from the Gallery App in the Events App. The PerchAssets_Assets class has a public function called import_from_perch_gallery() which seems want to log resources. Not sure if I am reading this correctly. I was hoping that someone could give me some guidance as to whether I can use this function to do what I need to do (share assets from the Gallery).

I am not sure whether I am barking up the wrong tree here entirely. So, even just knowing if I should be looking to another solution would be very much appreciated.

Thanks.

Gerry Valentino

Gerry Valentino 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, I would expect that to do what you're after. Does it not?

At this point, no. The assets I've uploaded to the Gallery are not showing up as available resources in the other apps. I am not certain whether or not this functionality should be happening natively.

Should images uploaded through the Gallery App log to the Resources tables or do I need to call the import method explicitly to get that to happen? And if so, from where should I call it?

I'm a long time user/fan of PERCH. But, this is my first attempt at any kind of real developing with PERCH 2. So, I still trying to figure out the nuts and bolts.

Many thanks for your help Drew.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Gallery is quite old and doesn't have support for Assets at the moment. Most things that Gallery does are possibly better done with a the regular content tools these days.

What's the bigger picture of what you need to achieve?

It's an art gallery site. Site visitors need to be able to access image galleries by artist or by exhibit. MANY of the pieces are utilized in multiple exhibits - and there are hundreds of pieces. So, I only want to upload them once each. I thought that the work around would be to create a gallery for each artist and upload all of the pieces there and then create an event for each exhibit into which I could call the requisite images.

Not sure if this makes sense? Let me know if I am not being clear. Also, haven't checked it out... but, would RUNWAY be a better candidate for something like this?

Thanks.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

That sounds like ideal Runway material using Collections https://docs.grabaperch.com/runway/collections/ and Relationships. That's the sort of functionality it was designed for.

Hey Rachel. Thanks for the feedback and the link. I'll dig a bit deeper into the documentation. The site is currently built in PERCH. So, an upgrade to Runway might be the path of least resistance. Many thanks.