#933 - Ordering specification for main_image_fader block
| Identifier | #933 |
|---|---|
| Issue type | Feature request or suggestion |
| Title | Ordering specification for main_image_fader block |
| Status | Closed (no changes needed) |
| Handling member | Chris Graham |
| Addon | galleries |
| Description | Currently is hard-coded by ascending add date. |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Comments
It's not the same as the other blocks, as the use case for fading is rather different. For other blocks you may well show e.g. 80 results, so you say the order you want those results to flow out.
For this, you are likely to pick out just a small handful of things to fade, and want explicit control of what they are. So you give a parameter that says the explicit order.
An example:
order="i2,i10,v3,i9"
This shows image 2, then image 10, then video 3, then image 9.
If you want randomised orders, you could kind of fake that a bit using Tempcode...
{$BLOCK,block=main_image_fader,order={$SET_RAND,i2\,i10\,v3\,i9,i6\,i1\,v6\,i2,...}}
I realise that's not the nicest syntax in the world, but I've defined two possible orders there, and the Tempcode SET_RAND symbol will randomise which to pick. ",..." is there for illustration, to show you can make as many as you want -- obviously real code should not include that bit.
Or, you can use the ORDER BY rand() hack temp1024 gave you. That hack won't stop manual ordering working for the case where the 'order' parameter is passed, assuming you have less than 100 images and videos.
I realised you have sponsored this Sholzy, maybe change it to zero and hold the credits or move elsewhere?