Johani
(Joe)
2018 年 6 月 29 日午前 6:15
1
Responsive Carousel Galleries
12KB (Gzip)
2 http requests on initial load
IE 11+ & modern browsers
Github repository link
https://github.com/hnb-ku/Discourse-Slick-image-gallery
Desktop
Video
Mobile
Built using Ken Wheeler ’s Slick library - MIT license
“Free as in Bacon”
How do I install this?
You install this component just like any other theme. Follow the instructions in the official guide:
Importing new themes and theme components
head to Admin → Customize → Themes and press the Install button.
[image]
[image]
From the Install dialog, you can …
choose popular Discourse themes and theme components
install from a Git repository URL link
install from your local device (rare)
If you are installing a complete theme, you’re done!
If you install a theme component , you will need to add that theme component to your active themes. Keep reading.
Add theme components to a …
Once you’re done, simply add the component to your current theme. Done!
How do I use this?
This component adds a button to the composer.
So all you have to do is:
1- Upload a bunch of images using the default Discourse upload button then highlight the code:
2- Click the gallery button.
You will get a static preview of the the selected images in the preview pane:
Done!
Anything else I need to know?
This component will inherit the current theme’s styles.
Here’s the theme component running on a different theme:
Can I use both Slick and Tiles at the same time?
You bet!
This is possible by making both slick and tiles components of a theme.
Like this:
You can then make “my theme” in the example above the default theme or make it user-selectable and it would include both Slick and Tiles.
Bug reports / Suggestions / PRs welcome.
「いいね!」 60
tshenry
(Taylor)
2018 年 6 月 29 日午前 6:56
2
Yes! Been waiting for this. Keep up the awesome work
「いいね!」 6
I can’t see the grey navigation dots under the gallery when using with Material Design Theme.
「いいね!」 1
Johani
(Joe)
2018 年 6 月 30 日午前 7:26
4
Good catch, thanks for reporting
It’s all fixed now:
Go ahead and update the theme it won’t be an issue anymore.
「いいね!」 7
vchrizz
(Christoph Loesch)
2018 年 6 月 30 日午前 7:26
5
seems like slick does not work with recent 2.0.0.beta5
after upgrade from 2.0.0.beta4 (where it worked nicely), now the page simply does not load and in browser console i see the following error twice.
_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:29446 TypeError: Cannot set property 'slick_add_images_prompt' of undefined
at (index):104
at O (_application-4f2596d165aa73d5730c4d02b5334e59b8f55b495d4197974d87bd84efa1c94b.js:21941)
at Object.initialize (_application-4f2596d165aa73d5730c4d02b5334e59b8f55b495d4197974d87bd84efa1c94b.js:6960)
at _ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:16963
at e.each (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:15063)
at e.topsort (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:15030)
at e.topsort (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:14975)
at s._runInitializer (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:16978)
at s.runInstanceInitializers (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:16962)
at s._bootSync (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:15281)
「いいね!」 1
Johani
(Joe)
2018 年 6 月 30 日午前 7:26
7
There was a small update today that fixes the translation error for good! If you’re on beta 7 and face any errors, please update the theme.
「いいね!」 4
Great theme! How can I translate strings? (I am french)
Also I did some test and it’s not working…
「いいね!」 1
Johani
(Joe)
2018 年 6 月 30 日午前 7:26
9
I just tested and everything seems to be working ok? Are you seeing any errors in the console? What version of Discourse are you on?
Like with Tiles, I also added a couple of settings that will allow you to change the strings:
「いいね!」 5
Thanks!
But I still have problem with the plugin. The theme is up to date.
Johani
(Joe)
2018 年 6 月 30 日午前 7:26
11
Can you please upload those images here so I can test?
「いいね!」 1
Is it normal that the text is not displaying?
「いいね!」 1
This isn’t working for me:
Discourse: v2.0.0.beta10 +49
Johani
(Joe)
2018 年 6 月 30 日午前 7:26
16
@Francois_Douville
No, it’s not normal. I think I know what the problem is, the theme might need to be translated. I will post an update on that soon.
@Vaping_Community
I just checked on v2.0.0.beta10 +49
and everything seems to be working in order.
Can you share more details about what’s happening on your install?
「いいね!」 4
For some reason it wasn’t working with larger images, had to reset some settings and refresh to get it to work but it is working now, great theme addon, thanks!
「いいね!」 1
Is it possible to display another icon? My community thinks they have to display slick even if they have 1 image.
「いいね!」 1
tshenry
(Taylor)
2018 年 6 月 30 日午前 7:26
19
If you have a font-awesome icon in mind, you can do something like so:
.SlickGallery .fa-picture-o:before {
content: "\f152"; // font awesome code
}
「いいね!」 5
Later edit: my mistake.
The right mode is like this:
<div data-theme-slick="1">





</div>
Not like this:
<div data-theme-slick="1">

</div>
<div data-theme-slick="1">

</div>
<div data-theme-slick="1">

</div>
How can I make the images look like here? Without the black background.
Summary