Search…

X3 Photo Gallery Support Forums

Search…
 
olidie
Topic Author
Posts: 3
Joined: 21 Dec 2021, 06:09

Possible to add more the one folder in Gallery Assets?

21 Dec 2021, 06:37

Hi Karl,
right now I am testing X3 to see if it can help me bring my old, out of date website back to new life. So far it is going great but I am missing one possibility or feature:

Having several gallery subfolders I would love to able to display a (limited) number of (random, not by date) pictures coming from all subfolders in the main gallery. Unfortunately gallery > settings > gallery > advanced > Gallery Assets only offers to display images from one subfolder.  Is something like gallery/* possible?

Cheers
Oliver
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Possible to add more the one folder in Gallery Assets?

21 Dec 2021, 06:57

This has been requested by a few others earlier, but unfortunately it is not currently possible in X3.

I have noted it down for a future update, but it won't be immediately since assigning random images from multiple random folders is currently incompatible with X3 page-cache, and it's not really feasible to extract all this info in real-time for each visitor request. Something for the future, definitely ...
 
olidie
Topic Author
Posts: 3
Joined: 21 Dec 2021, 06:09

Re: Possible to add more the one folder in Gallery Assets?

21 Dec 2021, 07:18

Thank you for your lightning fast response, Karl.
Would it be easier to make the gallery assets entry random in the sense of picking a different one of the subfolders every time the main gallery is accessed?

Oliver
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Possible to add more the one folder in Gallery Assets?

21 Dec 2021, 08:43

olidie wrote:Would it be easier to make the gallery assets entry random in the sense of picking a different one of the subfolders every time the main gallery is accessed?
Are you asking if this would be easy to implement? In the current state of X3, pages get "rendered" into cache, which means all page html output gets pre-created (after first visit), and successive visits to the page are therefore lightning-fast. As you may understand, this is not compatible with selecting different random gallery inputs per-visit, as this would require re-compiling galleries on a per-visit basis. Technically, your suggestion does make sense if it's to only load images from a single folder, but this still means you are bypassing cache for this random-page, which would have to re-compile itself on each visit to create random output for each visit. Besides, even if it picks only a SINGLE subfolder every visit (instead of multiple), it would still need to loop all images and extract all image-data from that subfolder. Unfortunately, this is therefore not currently an option in X3.

As mentioned in previous reply, it could be an option in the future, but only after some major changes. For example, cache might get stored in json files, which can then be shared, making dynamic pages faster (although never as fast as completely pre-rendered pages like in current X3). Something for the future.

For now, your options are limited. Why not create a hidden folder with the entire pool of random images you want to display? Then assign this folder as "assets" folder, set an X "limit" for the amount to display, and set sort to "shuffle". The page will be fast because it gets pre-rendered and cached, yet it will display X random images, different for each visit, randomized by Javascript from the pool of available images.
 
olidie
Topic Author
Posts: 3
Joined: 21 Dec 2021, 06:09

Re: Possible to add more the one folder in Gallery Assets?

21 Dec 2021, 13:37

Thank you again, Karl.
mjau-mjau wrote:
In the current state of X3, pages get "rendered" into cache, which means all page html output gets pre-created (after first visit), and successive visits to the page are therefore lightning-fast.
I now get why my request is not as easy as I thought it would be.
For now, your options are limited. Why not create a hidden folder with the entire pool of random images you want to display? Then assign this folder as "assets" folder, set an X "limit" for the amount to display, and set sort to "shuffle". The page will be fast because it gets pre-rendered and cached, yet it will display X random images, different for each visit, randomized by Javascript from the pool of available images.
Yes, this is what I am trying right now. Seems like a practical and easy solution.

Thanks
Oliver