Building a multi-image gallery the right way?

edited September 2015 in Modules
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 agree, natively, it's pretty clunky.

    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.
  • edited 10:48AM
    Unfortunately, there doesn't appear to be a field type that supports what you need. However, you could try wrapping up all the logic you are implementing into your image gallery form field code and create a custom field type. More information on creating custom field types can be found at the following links:
    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.
  • edited 10:48AM
    Hi almostcompletely,
    if you have finished your gallery approach, please let me know :-)
    This sound like something I can also use in my current project...
  • edited 10:48AM
    Image Gallery is pending till today, I checked with these demo but not works. Please help me to get it done.

    http://www.chestnutstrand.com/photogallery

    Repo:
    https://github.com/JBWebServices/FUEL-CMS-Photo-Gallery
  • Yeah. Both of those are old and problematic. I've built my own but it's not in a state that I can easily share and is still pending some features. Keep an eye on the forums, one day when I have enough bandwidth I'll collect it all together and post what I have...
  • edited 10:48AM
    Hi thanks for your quick response on my query. But my project is in pending due to that gallery, please guide me how can we get.
Sign In or Register to comment.