← Back to November Gallery Pro Support
I can't seem to find a way to access the gallery-level description field on a page. Is that field just an internal-only type thing? Ideally, I'd like to manage my gallery descriptions in the Gallery manager, rather than on individual pages. Dumping {{ dump(embeddedGallery.gallery.toArray) }}
and other variations of that don't reveal it to me. Thanks in advance!
I guess the same would be for the preview image as well. Can't seem to figure out how to access it.
Last updated
Ok, I figured out at least one way to do it by using the Builder->Record Details
component. :)
Hi Scott56276!
First of all, thanks for purchasing the plugin!
If I understand you correctly, you've created galleries on the "Galleries" back-end page, and you'd like to use Twig in your CMS page to render the "Name" and "Description" and "Preview Image" for the given gallery (the one selected in the component inspector).
I've done some work on the plugin to help you achieve your aims...if I understand them correctly :-)
Please update your plugin first! You should get the newest version, v1.0.7.
You should then be able to access the name that you give a gallery (that you uploaded using the "Galleries" back-end page) via Twig code as follows:
{{ customGallery.gallery.name }}
(please replace "customGallery" with the alias of your component)
You can also access the description: {{ customGallery.gallery.description }}
And you can access the URL of the preview image as follows: {{ customGallery.gallery.previewImage.url }}
I've added some example code to the demo website and expanded the documentation to explain the newly available options.
Please let me know if this works for you, and even better, please leave a review for the plugin if you like it! It really helps (this isn't an Android app with millions of users, you are user #5 actually!)
Awesome response, thanks! A bit of an issue though ... upgraded, then reloaded a simple gallery page, and got this:
Also, on the preview image part, I should clarify a bit I guess.
Basically, what I am trying to accomplish is to have a single "hub" page, which links to all of my November galleries. Each gallery would be powered by a shared page (per my other post in the support forums here). So only two pages total, no matter how many galleries I wanted to show.
So, here are my thoughts on maybe how to implement it (note, I am an experienced Laravel dev, but I am still new to OctoberCMS, so keep that in mind lol).
I am proposing a new component, maybe called "November Gallery Hub" or something. This component would basically be dropped onto a landing page, and would allow you to select/filter whatever galleries (or all of them) that you want to show in the hub.
The component would use the preview images for those galleries and show them in a grid, etc. Clicking on an image would take you to the gallery page for that gallery.
Of course, you could add all sorts of bells and whistles to the component, to adjust styling, presentation, etc. Hopefully you get the idea :)
Thanks for your consideration, and I will definitely give a review momentarily!
Hmm yes I guess you would get that if you don't set a preview image for a gallery. No chance for unit tests on a hobby project like this plugin unfortunately!
Fixed.
Please download the latest version, 1.0.9.
Have a great day!
The 1.0.9 fix works great! Yes, I am happy to be the "unit tester" by trial and error lol. Like you, I am slammed with so many dev projects I can't find time to sleep these days! :D
In response to your latest post - which unfortunately I did not see before posting my previous reply - that's a great idea, and I've been thinking of implementing something along those lines for a while.
Unfortunately, I'm not sure when I'll find time to actually implement it. To be honest with you, developing this plugin took...many hours. It was a great learning experience! And I hope to keep it updated and to expand it with functionality like you described. But I also have to earn a living, which obviously won't be with OctoberCMS (I've earned $105 since publishing this plugin a year ago...).
I wish more people used October, it really is a nice CMS ecosystem. Perhaps if they spent more time marketing it...I don't know.
Anyways, thanks for your suggestion and I'll let you know if I ever get around to it! You should be able to implement such a feature manually with some coding actually......and it'd be a good learning exercise for you! Check out the official documentation on running queries for a start. You'll need to query the zenware_novembergallery_gallery table to get a list of all of your galleries, loop through it, and generate a link to each individual gallery along with the thumbnail image.
Good luck!
Sounds good, and I may just do that. If I can up with anything worthwhile for this, do you accept pull requests on the GitHub repo?
Sure thing!
Also, if you're learning OctoberCMS, I wanted to suggest that you consider creating a plugin yourself. I've found it to be the best way to learn the inner workings of the platform. Although the documentation is quite scarce. I learned mostly from the source code of other plugins published on GitHub.
Hi Scott, I've decided to implement your "November Gallery Hub" suggestion. I'll let you know once a usable version is out! Cheers, Laz
Scott, this is done, please update your plugin to v 1.1.10 and refer to the demo as well as the docs to see how it works. Hopefully it will fit your purpose! Let me know if you have any questions.
1-13 of 13