Gallery Dir

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Barrowboy
Forum Members
Forum Members
Posts: 223
Joined: Mon Dec 16, 2013 4:09 pm

Gallery Dir

Post 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
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1978
Joined: Mon Jan 29, 2007 4:47 pm

Re: Gallery Dir

Post 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}.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Barrowboy
Forum Members
Forum Members
Posts: 223
Joined: Mon Dec 16, 2013 4:09 pm

Re: Gallery Dir

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Gallery Dir

Post 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.
Barrowboy
Forum Members
Forum Members
Posts: 223
Joined: Mon Dec 16, 2013 4:09 pm

Re: Gallery Dir

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Gallery Dir

Post 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.
Barrowboy
Forum Members
Forum Members
Posts: 223
Joined: Mon Dec 16, 2013 4:09 pm

Re: Gallery Dir

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Gallery Dir

Post 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?
Barrowboy
Forum Members
Forum Members
Posts: 223
Joined: Mon Dec 16, 2013 4:09 pm

Re: Gallery Dir

Post 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.
Post Reply

Return to “Modules/Add-Ons”