Jump to content

Storing a drop list somewhere!?


rushy
 Share

Recommended Posts

I've been working on making an online photo gallery for some time now and I have it working well using ProcessWire for storage and indexing of my images. Basically I have a series of albums represented by pages using my album template and this contains a images collection (usual Pageimages). I'm using the tags feature to tag the images so I can search across all the albums for a subject of interest to see all images for any tag in one view. This work well, and when I initialise I scan all images and build a list of all tags with the number of images with each tag and populate a drop down list with this info. so a user can select a tag from the list and see just the tag of interest.

So far so good, but as I now have around 8000 images in the database the initial scanning does take a few seconds. It occurred to me that once this scan is done, it would be better to store this info on disc as this data will only change infrequently and only need rescanning if a tag is changed (such as an image is deleted or added). My question is how should I store this info? For example should I use an XML file? Or perhaps JSON? I could check for this file at start up and simply load that data into my drop list which would speed up start up. But I wondered if I could keep this list in a PW field somewhere. It's basically just a text list, but it does not seem obvious to me how to best store this in PW. Any ideas on how one would tackle this would be very interesting to me....

Thanks!

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...