View Issue Details

IDProjectCategoryView StatusLast Update
0000933Composrgalleriespublic2013-01-26 00:11
ReporterChris GrahamAssigned ToChris Graham 
SeverityFeature-request 
Status closedResolutionno change required 
Product Version 
Fixed in Version 
Summary0000933: Ordering specification for main_image_fader block
DescriptionCurrently is hard-coded by ascending add date.
TagsNo tags attached.
Time estimation (hours)1
Sponsorship open

Activities

Chris Graham

2012-12-09 14:37

administrator   ~0001094

Last edited: 2012-12-09 14:38

View 3 revisions

Actually I have just looked at the code again and you CAN do ordering already.

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?

Issue History

Date Modified Username Field Change