Page 1 of 1
Gallery Dir
Posted: Mon Jun 01, 2015 8:47 am
by Barrowboy
Hi
Is it possible to change the gallery directory from a variable.
I have a variable called $selection which holds the names of sub-directory's I would like the page to change if any of these are selected.
Within the template I have {gallery dir="images"} how can the variable be added so that the directory is changed.
Thanks
Re: Gallery Dir
Posted: Mon Jun 01, 2015 11:41 am
by Jo Morg
I'm not sure what values the dir parameter accepts but assuming that $selection holds a valid value for that parameter you could use {gallery dir=$selection}.
Re: Gallery Dir
Posted: Tue Jun 02, 2015 7:07 am
by Barrowboy
Hi
Thanks for the info that works just fine.
But could I take it one stage further by also adding a image-field-definition so we could pick out a single image or any image with the field set to say 'Artist'.
Thanks
Re: Gallery Dir
Posted: Tue Jun 02, 2015 7:21 am
by velden
Not sure what you mean. You may want to tell exactly what you want to accomplish if possible with an example. Probably someone already did it before.
Re: Gallery Dir
Posted: Tue Jun 02, 2015 9:39 am
by Barrowboy
Hi
Sorry if I didn't make myself clear.
Now that I am selecting the correct dir from the $selection which shows all the images, I would now like to be able to select from that list just one image or if possible a group. I was trying to use an image-field-definition, but I was unsure how the field could be added to the already dir=$selection.
I can easily put the field into a variable so I was trying something like this" dir=$selection and $group" but unsure what the right syntax was for 'and' or if it was even possible.
Maybe there is another way.
The idea being you would select from two list one for the gallery dir and another to select which group of images to show from that list.
I would have thought this was possible in someway.
Regards
Re: Gallery Dir
Posted: Tue Jun 02, 2015 9:47 am
by velden
Would it be possible using a category hierarchy?
cat I
sub cat 1.1
sub cat 1.2
...
cat II
sub cat 2.1
sub cat 2.2
...
...
Done that before, but was a not very simple. Using ajax for dynamic loading of images.
Re: Gallery Dir
Posted: Tue Jun 02, 2015 9:57 am
by Barrowboy
Hi Velden
Yes I think that would be possible, I have already tried something similar, but I find it means duplicating or triplicating the images.
On a large list it adds enormously to file size on the server.
I was hoping just to have all the images in one folder and then select the require ones.
Cheers
Re: Gallery Dir
Posted: Tue Jun 02, 2015 10:00 am
by velden
So what would be the content of the extra image field definition? Could you give an example?
One image can be member of multiple groups?
Re: Gallery Dir
Posted: Tue Jun 02, 2015 10:08 am
by Barrowboy
Hi again
I was thinking along the lines of a dropdown which could contain something like group1,group2,group3 etc. Or even just letters, A,B,C,D, and so on.
These could then be attached to the relevant images, and then using that field to identify them in the gallery directory list.
Any ideas.