Search the Community
Showing results for tags 'plz'.
Found 1 result
So I'm outputting an image field array, I believe this is known as WireArray (bare with me, I only started developing for ProcessWire Yesterday). The cheatsheet has to be one of the best things ever! Not only does it show how simple ProcessWire is and how well crafted the API is, kudos to whoever came up with the cheatsheet. One thing I would like to see is example usages when you click more because at the moment, more doesn't really tell you anything more. I can tell it's inspired by jQuery's API documentation so I have no doubt this will be coming. So, moving on to the problem I'm having, looking at the cheatsheet $a->shift() will remove the first item for the array and then return it. So I have $gallery = $page->gallery; // A multi-upload image field $featured = $gallery->first()->size(800,550)->url; // Works fine $slider = $gallery->shift() // Doesn't work $slider = $gallery->pop() // Doesn't work $footer = $gallery->last()->size(800,1100)->url; // Works fine So my page layout goes like this: ___________ |__________ | <-- $featured // First Image | | | $slider // Image Gallery --> | | | <-- $page->content // Body Content Field |_____|____ | |__________| <-- $footer // Footer Image I have no idea if that example helps, but for usability that's how I want the gallery to work, so the user can just drag all their images in at once, move the featured to the front and the footer to the back. However $gallery->shift() returns nothing and $gallery->pop() returns nothing. $gallery->slice(1) get's rid of the first one in that array but I want to get rid of the first and last. Thanks, Tom