bytesource Posted December 5, 2012 Share Posted December 5, 2012 Hi Everyone, I currently use the images fieldtype to upload and output images. As I sometimes need to upload many images per page, and each page's images are stored in a separate folder, I would like to know if there fieldtype that allows me to select a folder and stores its items in an array that I can loop through in the template? Link to comment Share on other sites More sharing options...
MatthewSchenker Posted December 5, 2012 Share Posted December 5, 2012 Greetings bytesource, If I understand you correctly, you just need to create a field of the type "image" and allow the user to upload as many images as you want. Let's say this field is called "gallery_images." You can make the call in the template as follows: <?php foreach ($page->gallery_images as $image) { ?> <img src="<?php echo $image->url; ?>" /> <?php } ?> Thanks, Matthew EDIT: Sorry, I didn't respond to the part about the folders! Again, if I understand what you're asking correctly, you don't need to specify the folder, because ProcessWire takes care of that part for you. Just accessing the field via $page gets the rght images. Link to comment Share on other sites More sharing options...
bytesource Posted December 6, 2012 Author Share Posted December 6, 2012 Hi Mathew, Let's say this field is called "gallery_images." You can make the call in the template as follows: <?php foreach ($page->gallery_images as $image) { ?> <img src="<?php echo $image->url; ?>" /> <?php } ?> That's how I am doing it right now. What I wanted to ask is if there is a way to just specify a folder instead of uploading every single image one by one. However, I just realized that I can select more than one image at a time, thus turning the once repetitive task of uploading images into a one-time task. 1 Link to comment Share on other sites More sharing options...
Wanze Posted December 6, 2012 Share Posted December 6, 2012 Depending on some settings of your server, you can also upload .zip Files http://processwire.com/videos/ajax-file-uploads/ Link to comment Share on other sites More sharing options...
MatthewSchenker Posted December 6, 2012 Share Posted December 6, 2012 Hello bytesource, ... However, I just realized that I can select more than one image at a time, thus turning the once repetitive task of uploading images into a one-time task. Yes, I also overlooked this feature when I first started using ProcessWire. But then I found it, and it makes a big difference in adding photos. Like everything else in this system, it's as much as we need without adding more than we need. Thanks, Matthew 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now