How would you access a folder full of images, get the url for each image and put it in an array, then {{each}} over that array to display each image on a page of my choosing? Everyone keeps saying CollectionFS, but for some reason, when I set it up:
var imageStore = new FS.Store.FileSystem('images', {
path: '~/category/engagements'
});
Images = new FS.Collection('images', {
stores: [imageStore]
});
I can access Images in the console, but the array is empty. Isn’t this all I need to do?
So how do I automatically scan, grab the file names and path of static images so I can then place them on a page of my choosing? I know this is probably simple, just not sure of the syntax to make it happen.
I am trying to make a basic photo gallery website for my sister. She is getting into photography pretty serious, has a ton of images now, and I’m just trying to display those images that she has already. Basically for her portfolio page. Eventually, yes, I’d like to be able to upload files, but just trying to display what she’s got right now.
That’s the problem, I have no idea how to do what you just suggested. I thought I was doing it correctly by following tutorials, but obviously I missed the mark somewhere.
Looking at my code above, isn’t that what I was doing though, scanning through and adding them to the collection? The collection kept coming up empty in the console, but it was present though. It’s like the scanning never happened.
Your goal is probably to loop through the folder of pre-existing images in a temporary directory and add them to the CFS collection , so CFS knows about them and they get added to their permanent location with a matching CFS document. Which is basically a batch upload.
It might be easier to code your image upload form first and then just upload the images.
tl;dr I don’t think CFS allows pre-seeded folders.