Search

Hello,

for an architectural site I am making a gallery page that displays all images of all projects. I have a datasource that pulls all images and sorts them randomly. This way the gallery does not show similar images next to each other but mixes the images of all projects. Visually this is what I want to achieve.

Of course the data source sorts the images every time again. I would like to get the same order every time I call the page (so that visitor can find an image again as it is at the same position it was before).

Is there a way to to do this, maybe by adding a hidden field with a random number to the images section that I use for sorting? I thought about sorting by id (using System Id Field) but images of one project in most cases have consecutive ids.

Thanks for your ideas! Moritz

Thinking aloud: Manual job, maybe to add a number from a group of numbers for each image. Maybe you add Select box field for that, with a predefined list of numbers. And then you just assign them randomly to your items and to sort by this value, not randomly.

When you say "assign them randomly", you do mean by hand or automatically, don't you? While this is not as elegant as I whish, it surely does the job. So thanks for the idea!

Yes, by hand. There's no way to have a random mean to be actually non random and static after all.

You actually want to have it ordered, but in a "random" style. So you just have to have datas for that.

Go and make yourself dirty man ;D

No, joking. You're welcome!

PS: Any new ideas are of course welcome.

If the number of images you’re dealing with is a narrow one, you could also take advantage of the Order Entries field to “randomly” order each image entry: the possibility of dragging and dropping image entries directly in their section table would save you quite a few time.

If the number of images you’re dealing with is a narrow one

Could be in that case. Also could work within a bigger section, if you would use Publish filtering to narrow the list for you.

Also, if its actually a selection of photos for an entry (lets say "project"), you could use Subsection Manager for that from that entry (project). Plays also well.

The solution I mentioned first was based from the core. These others takes than more extensions into play. But still its a manual job.

But still its a manual job.

I agree: no escape. ;-)

What about randomising your data source and having it cached, with the cache set to expire daily or so?

having it cached

I also had this idea and its an option. It would be automated, but I think this offers the least options besides that, that is the results could be also very well sorted in terms of "randomness" and also the cache would have to expire some time, either for its life cycle, or in case of an update on images.
This could end up with a manual handling of the automated process. But that depends on whats the actual desire.

Anyway, I still find it difficult to promote new projects or photos added over the time within this "random" presentation style. But maybe thats not the point of it.

Wow, I am amazed: I go off to work and when coming back now I find seven new comments. Thanks to you all.

@juro: Indeed, this style would be the wrong approach if it was the only one. The standard presentation style is a grid of project images, with one image per project. The gallery with randomised order is an additional presentation that shows all images of all projects, and it is much more fun browsing through the images when similar ones are not next to each other.

I am considering making myself dirty ;-) Cheers!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details