Building a multi-image gallery the right way?
Hello everyone.
Still fairly new to the whole FUEL system and am trying my hand at implementing a 'Projects' module with the ability to upload multiple images to it.
So far I've created the Projects module and I can add/edit projects just fine.
I've added a multifile field to the edit page so that multiple images can be uploaded. In addition to this I've added an on_after_post function to the Project_model so that any uploaded images are added to the 'project_images' database table (with the correct 'project_ref' number).
So far so good. However I'm now at a point where I'm trying to output associated project images on the 'edit project' page.
I've added some code to the form_fields function in the Projects_model so that any associated images are merged into $fields array and are thus output onto the page. But this all seems a bit clunky - as next I'll need to start thinking about editing,sorting,deleting images that are output onto the edit page - functionality that should surely be more readily available rather than manually built?
Am I going in the right direction or is there a much more elegant road I should be taking?
Any thoughts would be much appreciated.
Comments
I'm working on improving things (well for me anyway) in various ways. So far, I've changed the Assets manager to use CKFinder and have a system for adding numerous images to a record using CKFinder as a selector - like a gallery. The same code has allowed me to build a proper gallery/image collection manager so users can build numerous galleries and then link them to a page or record. I've also got a replacement for the file field (in image mode) that selects an image from CKFinder rather than uploading a new one.
Although I've published sites with these tools, they're still in beta (they do one specific job right but aren't overly flexible yet). I really need to try and get them into a proper deployable package too - preferably as plugins.
http://docs.getfuelcms.com/general/forms#association_parameters
http://www.getfuelcms.com/blog/2013/12/17/creating-a-color-picker-custom-field
http://www.getfuelcms.com/blog/2014/06/04/integrating-with-dropbox
If that is the route you go down and you create a field type you'd like to see in the distribution, let me know.
if you have finished your gallery approach, please let me know :-)
This sound like something I can also use in my current project...
http://www.chestnutstrand.com/photogallery
Repo:
https://github.com/JBWebServices/FUEL-CMS-Photo-Gallery