with that nice, very useful snippet, how could I place (with that [[ xx ]] style) a single (defined) picture out of a given gallery? It’s for presentation consistence and economy.
Maybe something like a third value with << &type= [ "random" | "latest" | "name (or id)" ] >> in mgSolo. Or something else.
if you want just a specific image, use the straight url of that image.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
☆ A M B ☆
- 24,524 Posts
I was just fussing over that the other day! I have a series of before/after galleries, each a set of 3 before and 3 after pictures. On the main page introducing the gallery, I wanted the first picture of the "after" set of three; this would always be the 4th picture in the gallery. The client will be adding more galleries, and their filenames have no consistancy or organization at all, so it needs to be dynamic.
I almost figured out the hack to do that; add bit of code so that if the "type" value was numeric select only that image from the given gallery. I think it will need a conditional to choose between two different database queries. I’ll be getting back to that later today.
If you know that the picture is always the 4th picture in each gallery with some certain sort order, take the SVN version, it has offset and limit parameters that you could use then, so for example you could do this in Ditto template that lists all the gallery documents:
[!MaxiGallery? &view_gallery=`[+id+]` &order_by=`date` &order_direction=`DESC` &offset=`3` &limit=`1`!]
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
☆ A M B ☆
- 24,524 Posts
Very nice!
Except that I find that childgalleries works even better for what I need. I just move the after trio to before the before trio, and it grabs the first image, which happens to be the one I want.
Now to figure out the template system since there’s no longer an option to get rid of the manage button.
To get rid of the manage pictures button, do a custom galleryOuterTpl that doesn’t have it.. for example just copy the default template content to a chunk and remove that [+maxigallery.managebutton+] parts from the top.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
☆ A M B ☆
- 24,524 Posts
Already done
is it so hard to do as proposed in the first post here? In the resources pages of the modx site for example, do they have a folder for each single image?